org.comedia.util.xml
Class CXmlDocument

java.lang.Object
  |
  +--org.comedia.util.xml.CXmlDocument

public class CXmlDocument
extends java.lang.Object

Presents XML document which can be read and written from/to stream. It parses the stream and build a tree structure with CXmlElement objects.


Constructor Summary
CXmlDocument()
          Constructs this class with default parameters.
CXmlDocument(CXmlElement rootElement)
          Constructs this class and assignes root XML element.
 
Method Summary
 CXmlElement getRootElement()
          Gets a root XML element which starts the document sructure.
static void main(java.lang.String[] args)
          The main function for test purposes.
 void readDocument(java.io.Reader in)
          Reads from input stream, parses and build a XML tree structure.
 void writeDocument(java.io.Writer out)
          Writes from output stream build XML tree structure of this document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CXmlDocument

public CXmlDocument()
Constructs this class with default parameters.

CXmlDocument

public CXmlDocument(CXmlElement rootElement)
Constructs this class and assignes root XML element.
Parameters:
rootElement - a root XML element.
Method Detail

readDocument

public void readDocument(java.io.Reader in)
                  throws java.io.IOException,
                         CXmlException
Reads from input stream, parses and build a XML tree structure.
Parameters:
in - an input stream to read this XML document.

writeDocument

public void writeDocument(java.io.Writer out)
                   throws java.io.IOException
Writes from output stream build XML tree structure of this document.
Parameters:
out - an output stream to write this XML document.

getRootElement

public CXmlElement getRootElement()
Gets a root XML element which starts the document sructure.

main

public static void main(java.lang.String[] args)
The main function for test purposes.