oracle.cabo.share.xml
Class TreeBuilder
java.lang.Object
|
+--oracle.cabo.share.xml.TreeBuilder
- public class TreeBuilder
- extends java.lang.Object
Class responsible for building a tree of objects from
an XML stack. TreeBuilders are thread safe, and so can
be used from multiple threads simultaneously.
Constructor Summary |
TreeBuilder()
Creates a TreeBuilder with no ParserManager or root class. |
TreeBuilder(ParserManager manager,
java.lang.Class rootClass)
Creates a TreeBuilder using a given ParserManager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TreeBuilder
public TreeBuilder()
- Creates a TreeBuilder with no ParserManager or root class.
Such a TreeBuilder can only be used with NodeParsers that never
try to use
ParseContext.getParser()
.
TreeBuilder
public TreeBuilder(ParserManager manager,
java.lang.Class rootClass)
- Creates a TreeBuilder using a given ParserManager.
- Parameters:
manager
- the ParserManager to userootClass
- the desired type of object to return as the root
parse
public java.lang.Object parse(XMLProvider provider,
org.xml.sax.InputSource source,
ErrorLog log)
throws java.io.IOException,
org.xml.sax.SAXException
- Parses the document.
- Parameters:
provider
- an implementation of the XMLProvider interfacesource
- a SAX input sourcelog
- an error log for recording errors- Returns:
- an object that is an instance of the desired class
parse
public java.lang.Object parse(XMLProvider provider,
org.xml.sax.InputSource source,
ParseContext context)
throws java.io.IOException,
org.xml.sax.SAXException
- Parses the document.
- Parameters:
provider
- an implementation of the XMLProvider interfacesource
- a SAX input sourcecontext
- a parsing context- Returns:
- an object that is an instance of the desired class
parse
public java.lang.Object parse(XMLProvider provider,
org.xml.sax.InputSource source,
ParseContext context,
NodeParser rootParser)
throws java.io.IOException,
org.xml.sax.SAXException
- Parses the document.
- Parameters:
provider
- an implementation of the XMLProvider interfacesource
- a SAX input sourcecontext
- a parsing contextrootParser
- the root parser to start with; if null,
a root parser will be derived based on the rootClass
requested in the constructor.- Returns:
- an object that is the result of parsing.