org.xins.common.xml
Class ElementParser

java.lang.Object
  extended byorg.xins.common.xml.ElementParser

public class ElementParser
extends Object

XML element parser. XML is parsed to produce Element objects.

Note: This parser is XML Namespaces-aware.

Since:
XINS 1.1.0
Version:
$Revision: 1.42 $ $Date: 2007/09/18 11:21:01 $
Author:
Anthony Goubard, Ernst de Haan

Constructor Summary
ElementParser()
          Constructs a new ElementParser.
 
Method Summary
 Element parse(InputStream in)
          Parses content of a character stream to create an XML Element object.
 Element parse(Reader in)
          Parses content of a character stream to create an XML Element object.
 Element parse(String text)
          Parses the specified String to create an XML Element object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementParser

public ElementParser()
Constructs a new ElementParser.

Method Detail

parse

public Element parse(String text)
              throws IllegalArgumentException,
                     ParseException
Parses the specified String to create an XML Element object.

Parameters:
text - the XML text to be parsed, not null.
Returns:
the parsed result, not null.
Throws:
IllegalArgumentException - if text == null.
ParseException - if the content of the character stream is not considered to be valid XML.
Since:
XINS 2.0.

parse

public Element parse(InputStream in)
              throws IllegalArgumentException,
                     IOException,
                     ParseException
Parses content of a character stream to create an XML Element object.

Parameters:
in - the byte stream that is supposed to contain XML to be parsed, not null.
Returns:
the parsed result, not null.
Throws:
IllegalArgumentException - if in == null.
IOException - if there is an I/O error.
ParseException - if the content of the character stream is not considered to be valid XML.
Since:
XINS 2.0.

parse

public Element parse(Reader in)
              throws IllegalArgumentException,
                     IOException,
                     ParseException
Parses content of a character stream to create an XML Element object.

Parameters:
in - the character stream that is supposed to contain XML to be parsed, not null.
Returns:
the parsed result, not null.
Throws:
IllegalArgumentException - if in == null.
IOException - if there is an I/O error.
ParseException - if the content of the character stream is not considered to be valid XML.


See http://www.xins.org/.