public class DocumentBuilderImpl extends javax.xml.parsers.DocumentBuilder implements JAXPConstants
JAXP_SCHEMA_LANGUAGE, JAXP_SCHEMA_SOURCE, W3C_XML_SCHEMA| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.DOMImplementation |
getDOMImplementation()
Obtain an instance of a
DOMImplementation object. |
javax.xml.validation.Schema |
getSchema()
Get a reference to the the
Schema being used by
the XML processor. |
boolean |
isNamespaceAware()
Indicates whether or not this parser is configured to
understand namespaces.
|
boolean |
isValidating()
Indicates whether or not this parser is configured to
validate XML documents.
|
boolean |
isXIncludeAware()
Gets the XInclude processing mode for this parser
|
org.w3c.dom.Document |
newDocument()
Non-preferred: use the getDOMImplementation() method instead of this
one to get a DOM Level 2 DOMImplementation object and then use DOM
Level 2 methods to create a DOM Document object.
|
org.w3c.dom.Document |
parse(org.xml.sax.InputSource is)
Parse the content of the given input source as an XML document
and return a new DOM
Document object. |
void |
reset()
Reset this
DocumentBuilder to its original configuration. |
void |
setEntityResolver(org.xml.sax.EntityResolver er)
Specify the
EntityResolver to be used to resolve
entities present in the XML document to be parsed. |
void |
setErrorHandler(org.xml.sax.ErrorHandler eh)
Specify the
ErrorHandler to be used by the parser. |
public org.w3c.dom.Document newDocument()
newDocument in class javax.xml.parsers.DocumentBuilderpublic org.w3c.dom.DOMImplementation getDOMImplementation()
javax.xml.parsers.DocumentBuilderDOMImplementation object.getDOMImplementation in class javax.xml.parsers.DocumentBuilderDOMImplementation.public org.w3c.dom.Document parse(org.xml.sax.InputSource is)
throws org.xml.sax.SAXException,
java.io.IOException
javax.xml.parsers.DocumentBuilderDocument object.
An IllegalArgumentException is thrown if the
InputSource is null null.parse in class javax.xml.parsers.DocumentBuilderis - InputSource containing the content to be parsed.org.xml.sax.SAXException - If any parse errors occur.java.io.IOException - If any IO errors occur.DocumentHandlerpublic boolean isNamespaceAware()
javax.xml.parsers.DocumentBuilderisNamespaceAware in class javax.xml.parsers.DocumentBuilderpublic boolean isValidating()
javax.xml.parsers.DocumentBuilderisValidating in class javax.xml.parsers.DocumentBuilderpublic boolean isXIncludeAware()
isXIncludeAware in class javax.xml.parsers.DocumentBuilderDocumentBuilderFactory.setXIncludeAware(boolean)public void setEntityResolver(org.xml.sax.EntityResolver er)
javax.xml.parsers.DocumentBuilderEntityResolver 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.setEntityResolver in class javax.xml.parsers.DocumentBuilderer - The EntityResolver to be used to resolve entities
present in the XML document to be parsed.public void setErrorHandler(org.xml.sax.ErrorHandler eh)
javax.xml.parsers.DocumentBuilderErrorHandler to be used by the parser.
Setting this to null will result in the underlying
implementation using it's own default implementation and
behavior.setErrorHandler in class javax.xml.parsers.DocumentBuildereh - The ErrorHandler to be used by the parser.public javax.xml.validation.Schema getSchema()
javax.xml.parsers.DocumentBuilderGet a reference to the the Schema being used by
the XML processor.
If no schema is being used, null is returned.
getSchema in class javax.xml.parsers.DocumentBuilderSchema being used or null
if none in usepublic void reset()
javax.xml.parsers.DocumentBuilderReset this DocumentBuilder to its original configuration.
DocumentBuilder is reset to the same state as when it was created with
DocumentBuilderFactory.newDocumentBuilder().
reset() is designed to allow the reuse of existing DocumentBuilders
thus saving resources associated with the creation of new DocumentBuilders.
The reset DocumentBuilder is not guaranteed to have the same EntityResolver or ErrorHandler
Objects, e.g. Object.equals(Object obj). It is guaranteed to have a functionally equal
EntityResolver and ErrorHandler.
reset in class javax.xml.parsers.DocumentBuilderCopyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.