All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.xml.async.DOMBuilder

java.lang.Object
   |
   +----oracle.xml.async.DOMBuilder

public class DOMBuilder
extends Object
implements Serializable, DOMBuilderConstants, Runnable
This class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation. to parse a XML document and build a DOM tree. The parsing is done in a separate thread and DOMBuilderListener interface must be used for notification when the tree is built.


Variable Index

 o inputXmlText
 o inputXmlURLLocation
 o inSource
 o inStream
 o inString
 o methodToCall
 o reader
 o result
 o rootName
 o url

Constructor Index

 o DOMBuilder()
Creates a new parser object.
 o DOMBuilder(int)
Creates a new parser object with a given id.

Method Index

 o addDOMBuilderErrorListener(DOMBuilderErrorListener)
Adds DOMBuilderErrorListener
 o addDOMBuilderListener(DOMBuilderListener)
Adds DOMBuilderListener
 o getDoctype()
Get the DTD
 o getDocument()
Gets the document
 o getId()
Returns the parser object id.
 o getReleaseVersion()
Returns the release version of the Oracle XML Parser
 o getResult()
Gets the document
 o getValidationMode()
Returns the validation mode
 o parse(InputSource)
Parses the XML from given input source
 o parse(InputStream)
Parses the XML from given input stream.
 o parse(Reader)
Parses the XML from given input stream.
 o parse(String)
Parses the XML from the URL indicated
 o parse(URL)
Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.
 o parseDTD(InputSource, String)
Parses the XML External DTD from given input source
 o parseDTD(InputStream, String)
Parses the XML External DTD from given input stream.
 o parseDTD(Reader, String)
Parses the XML External DTD from given input stream.
 o parseDTD(String, String)
Parses the XML External DTD from the URL indicated
 o parseDTD(URL, String)
Parses the XML External DTD document pointed to by the given URL and creates the corresponding XML document hierarchy.
 o removeDOMBuilderErrorListener(DOMBuilderErrorListener)
Remove DOMBuilderErrorListener
 o removeDOMBuilderListener(DOMBuilderListener)
Remove DOMBuilderListener
 o run()
This method runs in a thread
 o setBaseURL(URL)
Set the base URL for loading external enitites and DTDs.
 o setDoctype(DTD)
Set the DTD
 o setErrorStream(OutputStream)
Creates an output stream for the output of errors and warnings.
 o setErrorStream(OutputStream, String)
Creates an output stream for the output of errors and warnings.
 o setErrorStream(PrintWriter)
Creates an output stream for the output of errors and warnings.
 o setNodeFactory(NodeFactory)
Set the node factory.
 o setPreserveWhitespace(boolean)
Set the white space preserving mode
 o setValidationMode(boolean)
Set the validation mode
 o showWarnings(boolean)
Switch to determine whether to print warnings

Variables

 o reader
 protected Reader reader
 o rootName
 protected String rootName
 o inString
 protected String inString
 o inStream
 protected InputStream inStream
 o url
 protected URL url
 o inSource
 protected InputSource inSource
 o methodToCall
 protected int methodToCall
 o inputXmlURLLocation
 protected URL inputXmlURLLocation
 o inputXmlText
 protected String inputXmlText
 o result
 protected XMLDocument result

Constructors

 o DOMBuilder
 public DOMBuilder()
Creates a new parser object.

 o DOMBuilder
 public DOMBuilder(int id)
Creates a new parser object with a given id.

Methods

 o getId
 public int getId()
Returns the parser object id.

 o run
 public void run()
This method runs in a thread

 o addDOMBuilderListener
 public void addDOMBuilderListener(DOMBuilderListener p0)
Adds DOMBuilderListener

Parameters:
p1 - The DOMBuilderListener to add
 o addDOMBuilderErrorListener
 public void addDOMBuilderErrorListener(DOMBuilderErrorListener p0)
Adds DOMBuilderErrorListener

Parameters:
p1 - The DOMBuilderErrorListener to add
 o removeDOMBuilderListener
 public synchronized void removeDOMBuilderListener(DOMBuilderListener p0)
Remove DOMBuilderListener

Parameters:
p1 - The DOMBuilderListener to remove
 o removeDOMBuilderErrorListener
 public synchronized void removeDOMBuilderErrorListener(DOMBuilderErrorListener p0)
Remove DOMBuilderErrorListener

Parameters:
p1 - The DOMBuilderErrorListener to remove
 o getResult
 public synchronized Document getResult()
Gets the document

Returns:
The document being parsed
 o getDoctype
 public synchronized DTD getDoctype()
Get the DTD

Returns:
The DTD
 o showWarnings
 public synchronized void showWarnings(boolean yes)
Switch to determine whether to print warnings

Parameters:
yes - determines whether warnings should be shown
 o setErrorStream
 public final synchronized void setErrorStream(PrintWriter out) throws IOException
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings.

Parameters:
out - The PrintWriter to use for errors and warnings
 o setErrorStream
 public final synchronized void setErrorStream(OutputStream out) throws IOException
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings.

Parameters:
out - The output stream to use for errors and warnings
 o setErrorStream
 public final synchronized void setErrorStream(OutputStream out,
                                               String enc) throws IOException
Creates an output stream for the output of errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings. Additionally, an .exception is thrown if the encoding specified is unsupported.

Parameters:
out - The output stream to use for errors and warnings
enc - the encoding to use
Throws: IOException
if an unsupported encoding is specified
 o getDocument
 public synchronized XMLDocument getDocument()
Gets the document

Returns:
The document being parsed
 o setNodeFactory
 public synchronized void setNodeFactory(NodeFactory factory) throws XMLParseException
Set the node factory. Applications can extend the NodeFactory and register it through this method. The parser will then use the user supplied NodeFactory to create nodes of the DOM tree.

Parameters:
factory - The NodeFactory to set
Throws: XMLParseException
if an invalid factory is set
See Also:
NodeFactory
 o setDoctype
 public synchronized void setDoctype(DTD dtd)
Set the DTD

Parameters:
dtd - DTD to set and used while parsing
 o setValidationMode
 public synchronized void setValidationMode(boolean yes)
Set the validation mode

Parameters:
yes - determines whether the XML parser should be validating
 o setBaseURL
 public synchronized void setBaseURL(URL url)
Set the base URL for loading external enitites and DTDs. This method should to be called if the parse(InputStream) is used to parse the XML Document

Parameters:
url - The base URL
 o setPreserveWhitespace
 public synchronized void setPreserveWhitespace(boolean flag)
Set the white space preserving mode

Parameters:
flag - preserving mode
 o getValidationMode
 public synchronized boolean getValidationMode()
Returns the validation mode

Returns:
true if the XML parser is validating false if not
 o getReleaseVersion
 public synchronized String getReleaseVersion()
Returns the release version of the Oracle XML Parser

Returns:
the release version string
 o parse
 public final synchronized void parse(InputSource in) throws XMLParseException, SAXException, IOException
Parses the XML from given input source

Parameters:
in - the org.xml.sax.InputSouce to parse
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parse
 public final synchronized void parse(String in) throws XMLParseException, SAXException, IOException
Parses the XML from the URL indicated

Parameters:
in - the String containing the URL to parse from
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parse
 public final synchronized void parse(URL url) throws XMLParseException, SAXException, IOException
Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.

Parameters:
url - the url points to the XML document to parse.
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parse
 public final synchronized void parse(InputStream in) throws XMLParseException, SAXException, IOException
Parses the XML from given input stream. The base URL should be set for resolving external entities and DTD.

Parameters:
in - the InputStream containing XML data to parse.
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
See Also:
setBaseURL
 o parse
 public final synchronized void parse(Reader r) throws XMLParseException, SAXException, IOException
Parses the XML from given input stream. The base URL should be set for resolving external entities and DTD.

Parameters:
r - the Reader containing XML data to parse.
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
See Also:
setBaseURL
 o parseDTD
 public final synchronized void parseDTD(InputSource in,
                                         String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD from given input source

Parameters:
in - the org.xml.sax.InputSouce to parse
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parseDTD
 public final synchronized void parseDTD(String in,
                                         String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD from the URL indicated

Parameters:
in - the String containing the URL to parse from
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parseDTD
 public final synchronized void parseDTD(URL url,
                                         String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD document pointed to by the given URL and creates the corresponding XML document hierarchy.

Parameters:
url - the url points to the XML document to parse.
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
 o parseDTD
 public final synchronized void parseDTD(InputStream in,
                                         String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD from given input stream. The base URL should be set for resolving external entities and DTD.

Parameters:
in - the InputStream containing XML data to parse.
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
See Also:
setBaseURL
 o parseDTD
 public final synchronized void parseDTD(Reader r,
                                         String rootName) throws XMLParseException, SAXException, IOException
Parses the XML External DTD from given input stream. The base URL should be set for resolving external entities and DTD.

Parameters:
r - the Reader containing XML data to parse.
rootName - the element to be used as root Element
Throws: XMLParseException
if syntax or other error encountered.
Throws: SAXException
Any SAX exception, possibly wrapping another exception.
Throws: IOException
IO Error.
See Also:
setBaseURL

All Packages  Class Hierarchy  This Package  Previous  Next  Index