org.garret.xmlme
Class XMLParser

java.lang.Object
  extended byorg.garret.xmlme.XMLParser

public class XMLParser
extends java.lang.Object

XML parser


Constructor Summary
XMLParser(java.io.InputStream in)
          XML parser for specified input stream with default encoding.
XMLParser(java.io.InputStream in, java.lang.String encoding)
          XML parser for specified input stream and encoding.
XMLParser(java.io.Reader reader)
          XML parser for specified reader
 
Method Summary
 java.util.Enumeration enumerateRootSiblings(java.lang.String rootElemName)
          Get enumeration of all root element siblings.
 XMLElement getRoot()
          Build complete XML occument tree and return root of this tree.
 void parse(XMLBuilder builder)
          Parse XML document and invoke builder callbacks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser(java.io.InputStream in)
XML parser for specified input stream with default encoding.

Parameters:
in - input stream providing XML data

XMLParser

public XMLParser(java.io.InputStream in,
                 java.lang.String encoding)
XML parser for specified input stream and encoding. This method uses own stream reader class which eliminate the problem at Symbian OS platform (NullPointerException when UTF-8 multibyte character crosses the boundary of the buffer)

Parameters:
in - input stream providing XML data
encoding - used encoding

XMLParser

public XMLParser(java.io.Reader reader)
XML parser for specified reader

Parameters:
reader - XML data reader
Method Detail

enumerateRootSiblings

public java.util.Enumeration enumerateRootSiblings(java.lang.String rootElemName)
Get enumeration of all root element siblings. Parser will extract siblings one-by-one and return XML element trees representing sibling and all its children. So XML tree for only one sibling is constructed in memory at each iteration.

Parameters:
rootElemName - name of the root element
Returns:
enumeration of root element siblings

getRoot

public XMLElement getRoot()
Build complete XML occument tree and return root of this tree. This method recursively loads all elements and constructs the complete tree in memory


parse

public void parse(XMLBuilder builder)
Parse XML document and invoke builder callbacks

Parameters:
builder - class providing callbacks