|
Xerces 1.4.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.xml.parsers.DocumentBuilder
Instances of DocumentBuilder
provide a mechansim for
parsing XML documents into a DOM document tree represented by an
org.w3c.dom.Document
object.
A DocumentBuilder
instance is obtained from a
DocumentBuilderFactory
by invoking its
newDocumentBuilder()
method.
NOTE: DocumentBuilder
uses several classes from the
SAX API. This does not require that the implementor of the
underlying DOM implementation use a SAX parser to parse XML content
into a org.w3c.dom.Document
. It merely requires that
the implementation communicate with the application using these
existing APIs.
ATTENTION: THIS IMPLEMENTATION OF THE "JAVAX.XML.PARSER" CLASSES
IS NOT THE OFFICIAL REFERENCE IMPLEMENTATION OF THE JAVA SPECIFICATION
REQUEST 5 FOUND AT
http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON
PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT
http://java.sun.com/xml
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Constructor Summary | |
protected |
DocumentBuilder()
|
Method Summary | |
abstract DOMImplementation |
getDOMImplementation()
Obtain an instance of a DOMImplementation object. |
abstract boolean |
isNamespaceAware()
Indicates whether or not this parser is configured to understand namespaces. |
abstract boolean |
isValidating()
Indicates whether or not this parser is configured to validate XML documents. |
abstract Document |
newDocument()
Obtain a new instance of a DOM Document object
to build a DOM tree with. |
Document |
parse(java.io.File f)
Parse the content of the given file as an XML document and return a new DOM Document object. |
abstract Document |
parse(InputSource is)
Parse the content of the given input source as an XML document and return a new DOM Document object. |
Document |
parse(java.io.InputStream is)
Parse the content of the given InputStream as an XML document and return a new DOM Document object. |
Document |
parse(java.io.InputStream is,
java.lang.String systemId)
Parse the content of the given InputStream as an XML document and return a new DOM Document object. |
Document |
parse(java.lang.String uri)
Parse the content of the given URI as an XML document and return a new DOM Document object. |
abstract void |
setEntityResolver(EntityResolver er)
Specify the EntityResolver to be used to resolve
entities present in the XML document to be parsed. |
abstract void |
setErrorHandler(ErrorHandler eh)
Specify the ErrorHandler to be used to resolve
entities present in the XML document to be parsed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected DocumentBuilder()
Method Detail |
public Document parse(java.io.InputStream is) throws SAXException, java.io.IOException
is
- InputStream containing the content to be parsed.java.io.IOException
- If any IO errors occur.SAXException
- If any parse errors occur.java.lang.IllegalArgumentException
- If the InputStream is nullDocumentHandler
public Document parse(java.io.InputStream is, java.lang.String systemId) throws SAXException, java.io.IOException
is
- InputStream containing the content to be parsed.systemId
- Provide a base for resolving relative URIs.java.io.IOException
- If any IO errors occur.SAXException
- If any parse errors occur.java.lang.IllegalArgumentException
- If the InputStream is nullDocumentHandler
public Document parse(java.lang.String uri) throws SAXException, java.io.IOException
uri
- The location of the content to be parsed.java.io.IOException
- If any IO errors occur.SAXException
- If any parse errors occur.java.lang.IllegalArgumentException
- If the URI is nullDocumentHandler
public Document parse(java.io.File f) throws SAXException, java.io.IOException
f
- The file containing the XML to parsejava.io.IOException
- If any IO errors occur.SAXException
- If any parse errors occur.java.lang.IllegalArgumentException
- If the file is nullDocumentHandler
public abstract Document parse(InputSource is) throws SAXException, java.io.IOException
is
- InputSource containing the content to be parsed.java.io.IOException
- If any IO errors occur.SAXException
- If any parse errors occur.java.lang.IllegalArgumentException
- If the InputSource is nullDocumentHandler
public abstract boolean isNamespaceAware()
public abstract boolean isValidating()
public abstract void setEntityResolver(EntityResolver er)
EntityResolver
to be used to resolve
entities present in the XML document to be parsed. Setting
this to null
will result in the underlying
implementation using it's own default implementation and
behavior.public abstract void setErrorHandler(ErrorHandler eh)
ErrorHandler
to be used to resolve
entities present in the XML document to be parsed. Setting
this to null
will result in the underlying
implementation using it's own default implementation and
behavior.public abstract Document newDocument()
Document
object
to build a DOM tree with. An alternative way to create a DOM
Document object is to use the
getDOMImplementation
method to get a DOM Level 2 DOMImplementation object and then use
DOM Level 2 methods on that object to create a DOM Document object.public abstract DOMImplementation getDOMImplementation()
DOMImplementation
object.DOMImplementation
.
|
Xerces 1.4.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |