ptolemy.backtrack.xmlparser
Class XmlOutput

java.lang.Object
  extended by ptolemy.backtrack.xmlparser.XmlOutput

public class XmlOutput
extends java.lang.Object

XML output from its tree representation.

Since:
Ptolemy II 5.1
Version:
$Id: XmlOutput.java 47482 2007-12-06 18:33:55Z cxh $
Author:
Thomas Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Field Summary
static java.lang.String DTD_HEAD1
          DTD header before the root element name.
static java.lang.String DTD_HEAD2
          DTD header after the root element name.
 
Constructor Summary
XmlOutput()
           
 
Method Summary
private static java.lang.String _createIndent(int indent)
          Return a string with the specified number of white spaces.
protected static void _outputXmlSubtree(ConfigXmlTree tree, java.io.Writer writer, int indent)
          Output the sub-tree to the writer with the specified number of indentations.
static void outputXmlTree(ConfigXmlTree tree, java.io.Writer writer)
          Output an XML tree to the writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DTD_HEAD1

public static final java.lang.String DTD_HEAD1
DTD header before the root element name.

See Also:
Constant Field Values

DTD_HEAD2

public static final java.lang.String DTD_HEAD2
DTD header after the root element name.

See Also:
Constant Field Values
Constructor Detail

XmlOutput

public XmlOutput()
Method Detail

outputXmlTree

public static void outputXmlTree(ConfigXmlTree tree,
                                 java.io.Writer writer)
                          throws java.io.IOException
Output an XML tree to the writer.

Parameters:
tree - The XML tree.
writer - The writer.
Throws:
java.io.IOException - If there is an IO exception during the output.

_outputXmlSubtree

protected static void _outputXmlSubtree(ConfigXmlTree tree,
                                        java.io.Writer writer,
                                        int indent)
                                 throws java.io.IOException
Output the sub-tree to the writer with the specified number of indentations.

Parameters:
tree - The sub-tree.
writer - The writer.
indent - The number of indentations.
Throws:
java.io.IOException - If there is an IO exception during the output.

_createIndent

private static java.lang.String _createIndent(int indent)
Return a string with the specified number of white spaces.

Parameters:
indent - The number of white spaces.
Returns:
A string with the specified number of white spaces.