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.
-
inputXmlText
-
-
inputXmlURLLocation
-
-
inSource
-
-
inStream
-
-
inString
-
-
methodToCall
-
-
reader
-
-
result
-
-
rootName
-
-
url
-
-
DOMBuilder()
- Creates a new parser object.
-
DOMBuilder(int)
- Creates a new parser object with a given id.
-
addDOMBuilderErrorListener(DOMBuilderErrorListener)
- Adds DOMBuilderErrorListener
-
addDOMBuilderListener(DOMBuilderListener)
- Adds DOMBuilderListener
-
getDoctype()
- Get the DTD
-
getDocument()
- Gets the document
-
getId()
- Returns the parser object id.
-
getReleaseVersion()
- Returns the release version of the Oracle XML Parser
-
getResult()
- Gets the document
-
getValidationMode()
- Returns the validation mode
-
parse(InputSource)
- Parses the XML from given input source
-
parse(InputStream)
- Parses the XML from given input stream.
-
parse(Reader)
- Parses the XML from given input stream.
-
parse(String)
- Parses the XML from the URL indicated
-
parse(URL)
- Parses the XML document pointed to by the given URL and
creates the corresponding XML document hierarchy.
-
parseDTD(InputSource, String)
- Parses the XML External DTD from given input source
-
parseDTD(InputStream, String)
- Parses the XML External DTD from given input stream.
-
parseDTD(Reader, String)
- Parses the XML External DTD from given input stream.
-
parseDTD(String, String)
- Parses the XML External DTD from the URL indicated
-
parseDTD(URL, String)
- Parses the XML External DTD document pointed to by the given URL and
creates the corresponding XML document hierarchy.
-
removeDOMBuilderErrorListener(DOMBuilderErrorListener)
- Remove DOMBuilderErrorListener
-
removeDOMBuilderListener(DOMBuilderListener)
- Remove DOMBuilderListener
-
run()
- This method runs in a thread
-
setBaseURL(URL)
-
Set the base URL for loading external enitites and DTDs.
-
setDoctype(DTD)
- Set the DTD
-
setErrorStream(OutputStream)
- Creates an output stream for the output of errors and warnings.
-
setErrorStream(OutputStream, String)
- Creates an output stream for the output of errors and warnings.
-
setErrorStream(PrintWriter)
- Creates an output stream for the output of errors and warnings.
-
setNodeFactory(NodeFactory)
- Set the node factory.
-
setPreserveWhitespace(boolean)
-
Set the white space preserving mode
-
setValidationMode(boolean)
-
Set the validation mode
-
showWarnings(boolean)
-
Switch to determine whether to print warnings
reader
protected Reader reader
rootName
protected String rootName
inString
protected String inString
inStream
protected InputStream inStream
url
protected URL url
inSource
protected InputSource inSource
methodToCall
protected int methodToCall
inputXmlURLLocation
protected URL inputXmlURLLocation
inputXmlText
protected String inputXmlText
result
protected XMLDocument result
DOMBuilder
public DOMBuilder()
- Creates a new parser object.
DOMBuilder
public DOMBuilder(int id)
- Creates a new parser object with a given id.
getId
public int getId()
- Returns the parser object id.
run
public void run()
- This method runs in a thread
addDOMBuilderListener
public void addDOMBuilderListener(DOMBuilderListener p0)
- Adds DOMBuilderListener
- Parameters:
- p1 - The
DOMBuilderListener
to add
addDOMBuilderErrorListener
public void addDOMBuilderErrorListener(DOMBuilderErrorListener p0)
- Adds DOMBuilderErrorListener
- Parameters:
- p1 - The
DOMBuilderErrorListener
to add
removeDOMBuilderListener
public synchronized void removeDOMBuilderListener(DOMBuilderListener p0)
- Remove DOMBuilderListener
- Parameters:
- p1 - The
DOMBuilderListener
to remove
removeDOMBuilderErrorListener
public synchronized void removeDOMBuilderErrorListener(DOMBuilderErrorListener p0)
- Remove DOMBuilderErrorListener
- Parameters:
- p1 - The
DOMBuilderErrorListener
to remove
getResult
public synchronized Document getResult()
- Gets the document
- Returns:
- The document being parsed
getDoctype
public synchronized DTD getDoctype()
- Get the DTD
- Returns:
- The
DTD
showWarnings
public synchronized void showWarnings(boolean yes)
- Switch to determine whether to print warnings
- Parameters:
- yes - determines whether warnings should be shown
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
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
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
getDocument
public synchronized XMLDocument getDocument()
- Gets the document
- Returns:
- The document being parsed
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
setDoctype
public synchronized void setDoctype(DTD dtd)
- Set the DTD
- Parameters:
- dtd -
DTD
to set and used while parsing
setValidationMode
public synchronized void setValidationMode(boolean yes)
- Set the validation mode
- Parameters:
- yes - determines whether the XML parser should be validating
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
setPreserveWhitespace
public synchronized void setPreserveWhitespace(boolean flag)
- Set the white space preserving mode
- Parameters:
- flag - preserving mode
getValidationMode
public synchronized boolean getValidationMode()
- Returns the validation mode
- Returns:
-
true
if the XML parser is validating
false
if not
getReleaseVersion
public synchronized String getReleaseVersion()
- Returns the release version of the Oracle XML Parser
- Returns:
- the release version string
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.
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.
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.
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
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
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.
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.
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.
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
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