org.ujac.util.table
Class TableSerializer

java.lang.Object
  extended by org.ujac.util.xml.BaseObjectSerializer
      extended by org.ujac.util.table.TableSerializer

public class TableSerializer
extends BaseObjectSerializer

Name: TableSerializer
Description: A class serializing/deserializing tables to/from XML.

Author:
lauerc

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ujac.util.xml.BaseObjectSerializer
BaseObjectSerializer.ObjectHandler, BaseObjectSerializer.StackElement
 
Field Summary
static String ATTR_ALIAS
          Constant for attribute 'alias'.
static String ATTR_ALIGN
          Constant for attribute 'align'.
static String ATTR_COLUMN
          Constant for attribute 'column'.
static String ATTR_HEADER_ALIGN
          Constant for attribute 'header-align'.
static String ATTR_LEVEL
          Constant for attribute 'level'.
static String ATTR_NAME
          Constant for attribute 'name'.
static String ATTR_TYPE
          Constant for attribute 'type'.
static String ATTR_WIDTH
          Constant for attribute 'width'.
static String TAG_CELL
          Constant for tag 'cell'.
static String TAG_COLUMN
          Constant for tag 'column'.
static String TAG_COLUMNS
          Constant for tag 'columns'.
static String TAG_HEADER
          Constant for tag 'header'.
static String TAG_LAYOUT_HINTS
          Constant for tag 'layout-hints'.
static String TAG_ROW
          Constant for tag 'row'.
static String TAG_ROWS
          Constant for tag 'rows'.
static String TAG_TABLE
          Constant for tag 'table'.
 
Fields inherited from class org.ujac.util.xml.BaseObjectSerializer
parentSerializer
 
Constructor Summary
TableSerializer()
          Constructs a TableSerializer instance with no specific attributes.
TableSerializer(String encoding)
          Constructs a TableSerializer instance with specific attributes.
 
Method Summary
 void endElement(BaseObjectSerializer.StackElement localElement, String content, BaseObjectSerializer.StackElement parentElement, Object root)
          Ends the given local element.
 void startElement(BaseObjectSerializer.StackElement localElement, BaseObjectSerializer.StackElement parentElement, Object root)
          Starts the given local element.
 void write(PrintWriter writer, Object obj)
          Writes an object to the given print writer.
 
Methods inherited from class org.ujac.util.xml.BaseObjectSerializer
closeOpenTag, delegateHandler, getEncoding, getRootLevel, getRootObject, indent, parseBooleanValue, parseIntValue, read, read, read, setEncoding, setRootLevel, startNewLine, write, write, writeAttribute, writeAttribute, writeAttribute, writeCloseTag, writeOpenTag, writeTag, writeTagBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_TABLE

public static final String TAG_TABLE
Constant for tag 'table'.

See Also:
Constant Field Values

TAG_COLUMNS

public static final String TAG_COLUMNS
Constant for tag 'columns'.

See Also:
Constant Field Values

TAG_COLUMN

public static final String TAG_COLUMN
Constant for tag 'column'.

See Also:
Constant Field Values

TAG_HEADER

public static final String TAG_HEADER
Constant for tag 'header'.

See Also:
Constant Field Values

TAG_LAYOUT_HINTS

public static final String TAG_LAYOUT_HINTS
Constant for tag 'layout-hints'.

See Also:
Constant Field Values

TAG_ROWS

public static final String TAG_ROWS
Constant for tag 'rows'.

See Also:
Constant Field Values

TAG_ROW

public static final String TAG_ROW
Constant for tag 'row'.

See Also:
Constant Field Values

TAG_CELL

public static final String TAG_CELL
Constant for tag 'cell'.

See Also:
Constant Field Values

ATTR_NAME

public static final String ATTR_NAME
Constant for attribute 'name'.

See Also:
Constant Field Values

ATTR_TYPE

public static final String ATTR_TYPE
Constant for attribute 'type'.

See Also:
Constant Field Values

ATTR_ALIAS

public static final String ATTR_ALIAS
Constant for attribute 'alias'.

See Also:
Constant Field Values

ATTR_WIDTH

public static final String ATTR_WIDTH
Constant for attribute 'width'.

See Also:
Constant Field Values

ATTR_ALIGN

public static final String ATTR_ALIGN
Constant for attribute 'align'.

See Also:
Constant Field Values

ATTR_HEADER_ALIGN

public static final String ATTR_HEADER_ALIGN
Constant for attribute 'header-align'.

See Also:
Constant Field Values

ATTR_LEVEL

public static final String ATTR_LEVEL
Constant for attribute 'level'.

See Also:
Constant Field Values

ATTR_COLUMN

public static final String ATTR_COLUMN
Constant for attribute 'column'.

See Also:
Constant Field Values
Constructor Detail

TableSerializer

public TableSerializer()
Constructs a TableSerializer instance with no specific attributes.


TableSerializer

public TableSerializer(String encoding)
Constructs a TableSerializer instance with specific attributes.

Parameters:
encoding - The encoding to use.
Method Detail

write

public void write(PrintWriter writer,
                  Object obj)
           throws IOException
Writes an object to the given print writer.

Overrides:
write in class BaseObjectSerializer
Parameters:
writer - The writer to write the WebForm to.
obj - The instance to write.
Throws:
IOException - In case an I/O failure occurred.

startElement

public void startElement(BaseObjectSerializer.StackElement localElement,
                         BaseObjectSerializer.StackElement parentElement,
                         Object root)
                  throws SAXException
Description copied from class: BaseObjectSerializer
Starts the given local element.

Specified by:
startElement in class BaseObjectSerializer
Parameters:
localElement - The element to process.
parentElement - The parent element if present, else null.
root - The root object of the data structure.
Throws:
SAXException - In case the parsing failed.
See Also:
BaseObjectSerializer.startElement(org.ujac.util.xml.BaseObjectSerializer.StackElement, org.ujac.util.xml.BaseObjectSerializer.StackElement, java.lang.Object)

endElement

public void endElement(BaseObjectSerializer.StackElement localElement,
                       String content,
                       BaseObjectSerializer.StackElement parentElement,
                       Object root)
                throws SAXException
Description copied from class: BaseObjectSerializer
Ends the given local element.

Specified by:
endElement in class BaseObjectSerializer
Parameters:
localElement - The element to process.
content - The content of the local element.
parentElement - The parent element if present, else null.
root - The root object of the data structure.
Throws:
SAXException - In case the parsing failed.
See Also:
BaseObjectSerializer.endElement(org.ujac.util.xml.BaseObjectSerializer.StackElement, java.lang.String, org.ujac.util.xml.BaseObjectSerializer.StackElement, java.lang.Object)


Copyright © 2003-2004 UJAC.org. All Rights Reserved.