erland.util
Class SimpleXMLParser

java.lang.Object
  extended by erland.util.SimpleXMLParser
All Implemented Interfaces:
XMLParserInterface

public class SimpleXMLParser
extends Object
implements XMLParserInterface

A simple implementation of an XML parser, this implementation does not require any third party XML parser libraries

Author:
Erland Isaksson

Constructor Summary
SimpleXMLParser()
           
 
Method Summary
 boolean parse(InputStream in, XMLParserHandlerInterface handler)
          Parse an XML document in an InputStream using the specified XML parser handler implementation
 boolean parse(String str, XMLParserHandlerInterface handler)
          Parse an XML document in String using the specified XML parser handler implementation
protected  int skipSpaces(String data, int pos)
          Calculate the position of the first real character after the specified position, skipping space and tab characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleXMLParser

public SimpleXMLParser()
Method Detail

skipSpaces

protected int skipSpaces(String data,
                         int pos)
Calculate the position of the first real character after the specified position, skipping space and tab characters.

Parameters:
data - The text string
pos - The start position in the string
Returns:
The position of the next real character, equal to string length if no more real character exist

parse

public boolean parse(InputStream in,
                     XMLParserHandlerInterface handler)
Description copied from interface: XMLParserInterface
Parse an XML document in an InputStream using the specified XML parser handler implementation

Specified by:
parse in interface XMLParserInterface
Parameters:
in - The InputStream with the XML document
handler - The XML parser handler implementation to use when parsing
Returns:
true/false (success/failure)

parse

public boolean parse(String str,
                     XMLParserHandlerInterface handler)
Description copied from interface: XMLParserInterface
Parse an XML document in String using the specified XML parser handler implementation

Specified by:
parse in interface XMLParserInterface
Parameters:
str - The String object with the XML document
handler - The XML parser handler implementation to use when parsing
Returns:
true/false (success/failure)


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