| java.lang.Object uk.org.ponder.saxalizer.DeSAXalizer
DeSAXalizer | public class DeSAXalizer (Code) | | The DeSAXalizer takes a tree of Java objects and writes them to an XML
stream. Architectural note - this used to be a stateless class with only
static methods. This resulted in a slightly cleaner design since all state
alterations were transparent, but in the end the number of arguments to
internal methods began to snowball. Constructing a DeSAXalizer costs
virtually nothing in the modern world.
|
Inner Class :static class SerialContext | |
Field Summary | |
final public static int | COMPACT_MODE A value for indentlevel that will suppress writing of the XML declaration. |
COMPACT_MODE | final public static int COMPACT_MODE(Code) | | A value for indentlevel that will suppress writing of the XML declaration.
|
DeSAXalizer | public DeSAXalizer()(Code) | | |
getDeSAXingObject | public SerialContext getDeSAXingObject()(Code) | | |
getIndent | public int getIndent()(Code) | | |
serializeSubtree | public void serializeSubtree(Object root, String roottag, OutputStream os)(Code) | | Write a serialized representation of an object subtree as XML to an output
stream. This method DOES NOT close the supplied output stream.
Parameters: root - The root object of the tree to be serialized. Must implementthe DeSAXalizable interface, as must alldescendents, or have types registered with theSAXLeafParser . Parameters: roottag - The tag to be supplied to the root object (all subobjectshave their tags supplied through the DeSAXalizable interface. Parameters: os - The output stream to receive the serialized data. The data willbe written in UTF-8 format. |
serializeSubtree | public void serializeSubtree(Object root, String roottagname, OutputStream os, int indentlevel)(Code) | | Write a serialized representation of an object subtree as XML to an output
stream. This method DOES NOT close the supplied output stream.
Parameters: root - The root object of the tree to be serialized. Must implementthe DeSAXalizable interface, as must alldescendents, or have types registered with theSAXLeafParser . Parameters: roottag - The tag to be supplied to the root object (all subobjectshave their tags supplied through the DeSAXalizable interface. Parameters: os - The output stream to receive the serialized data. The data willbe written in UTF-8 format. Parameters: forbidder - An interface through which clients may countermand theserialization of a particular subobject of the root. Each objectand tag will be supplied to this interface before serialization.null if all objects to be serialized withoutrestriction. Parameters: maxdepth - If this is not -1, subobjects below this depth from theroot will not be serialized. Parameters: indentlevel - The initial indent level in the XML output file to beapplied to the tag representing the root object. If this is not 0,an XML declaration will not be written to the file. If this isCOMPACT_MODE, newlines and indentation will not be written. |
toString | public String toString(Object root, String roottag, boolean compactmode)(Code) | | Render a DeSAXalizable object as a string.
Parameters: root - The object to be rendered as a string. Parameters: roottag - The root tag of the rendered tree The supplied object rendered as a String of XMLtags, minus declaration. |
|
|