erland.util
Class SimpleXMLParserHandler

java.lang.Object
  extended by erland.util.SimpleXMLParserHandler
All Implemented Interfaces:
XMLParserHandlerInterface

public class SimpleXMLParserHandler
extends Object
implements XMLParserHandlerInterface

An implementation of a XMLParserHandlerInterface. This will parse the XML document to a full XMLNode tree.

Author:
Erland Isaksson

Constructor Summary
SimpleXMLParserHandler()
           
 
Method Summary
 void characters(String str, int start, int length)
          Called one or several times for each values of a node in the XML document.
 void endDocument()
          Called in the end of the document when parsing has finished
 void endElement(String name)
          Called once at the end of each node in the XML document.
 XMLNode getData()
          Get the XMLNode tree that has been created during the parsing
 void startDocument()
          Called in the beginning of the document before parsing starts
 void startElement(String name, Map attributes)
          Called once at the start of each node in the XML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleXMLParserHandler

public SimpleXMLParserHandler()
Method Detail

getData

public XMLNode getData()
Get the XMLNode tree that has been created during the parsing

Returns:
The XMLNode tree

startDocument

public void startDocument()
Description copied from interface: XMLParserHandlerInterface
Called in the beginning of the document before parsing starts

Specified by:
startDocument in interface XMLParserHandlerInterface

endDocument

public void endDocument()
Description copied from interface: XMLParserHandlerInterface
Called in the end of the document when parsing has finished

Specified by:
endDocument in interface XMLParserHandlerInterface

startElement

public void startElement(String name,
                         Map attributes)
Description copied from interface: XMLParserHandlerInterface
Called once at the start of each node in the XML document. The value of the node is sent in XMLParserHandlerInterface.characters(String,int,int)

Specified by:
startElement in interface XMLParserHandlerInterface
Parameters:
name - The name of the node
attributes - The attributes of the node

endElement

public void endElement(String name)
Description copied from interface: XMLParserHandlerInterface
Called once at the end of each node in the XML document.

Specified by:
endElement in interface XMLParserHandlerInterface
Parameters:
name - The name of the node

characters

public void characters(String str,
                       int start,
                       int length)
Description copied from interface: XMLParserHandlerInterface
Called one or several times for each values of a node in the XML document. Observe that the whole document may be sent int the chars parameter, the position of the value in the string is specified with the start and length parameters.

Specified by:
characters in interface XMLParserHandlerInterface
Parameters:
str - The String object containing the value
start - The start position of the value
length - The length of the value


Copyright © 2003-2005 Erland Isaksson. All Rights Reserved.