com.lightdev.lib.xml.io
Class XmlTreeWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.BufferedWriter
          extended by com.lightdev.lib.xml.io.XmlWriter
              extended by com.lightdev.lib.xml.io.XmlTreeWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class XmlTreeWriter
extends XmlWriter

Writes XML from a tree model coming from a JXmlTree.

Assumes that the JXmlTree has only nodes that represent an XmlTag.

Version:
1, March 5, 2005
Author:
Ulrich Hilger, Light Development, http://www.lightdev.com, info@lightdev.com, published under the terms and conditions of the BSD License, for details see file license.txt in the distribution package of this software
See Also:
XmlTag, JXmlTree

Field Summary
static char ATTR_NAME_START
          character to indicate the start of an attribute
static char ATTR_SEPARATOR
          character to separate an attribute name from an attribute value
static char ATTR_VALUE_BORDER
          character to indicate the start or end of an attribute value
static char END_TAG_INDICATOR
          character to indicate an end tag
static char INDENT_CHAR
          the character to use to indent
static int INDENT_INCREMENT
          indent increment per level
static char TAG_END
          character to indicate a tag end
static char TAG_START
          character to indicate a tag start
static char XML_TAG_INDICATOR
           
 
Constructor Summary
XmlTreeWriter(Writer out)
          construct an XmlTreeWriter
 
Method Summary
 void write(JXmlTree tree)
          write a given tree in XML format
 
Methods inherited from class com.lightdev.lib.xml.io.XmlWriter
indent, writeEndTag, writeStartTag, writeTag, writeTag
 
Methods inherited from class java.io.BufferedWriter
close, flush, newLine, write, write, write
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDENT_INCREMENT

public static final int INDENT_INCREMENT
indent increment per level

See Also:
Constant Field Values

INDENT_CHAR

public static final char INDENT_CHAR
the character to use to indent

See Also:
Constant Field Values

TAG_START

public static final char TAG_START
character to indicate a tag start

See Also:
Constant Field Values

TAG_END

public static final char TAG_END
character to indicate a tag end

See Also:
Constant Field Values

END_TAG_INDICATOR

public static final char END_TAG_INDICATOR
character to indicate an end tag

See Also:
Constant Field Values

ATTR_NAME_START

public static final char ATTR_NAME_START
character to indicate the start of an attribute

See Also:
Constant Field Values

ATTR_SEPARATOR

public static final char ATTR_SEPARATOR
character to separate an attribute name from an attribute value

See Also:
Constant Field Values

ATTR_VALUE_BORDER

public static final char ATTR_VALUE_BORDER
character to indicate the start or end of an attribute value

See Also:
Constant Field Values

XML_TAG_INDICATOR

public static final char XML_TAG_INDICATOR
See Also:
Constant Field Values
Constructor Detail

XmlTreeWriter

public XmlTreeWriter(Writer out)
construct an XmlTreeWriter

Parameters:
out - Writer the writer to write to
Method Detail

write

public void write(JXmlTree tree)
           throws IOException
write a given tree in XML format

Parameters:
tree - JXmlTree the tree to convert to XML
Throws:
IOException