Methods Summary |
---|
public abstract org.w3c.dom.DOMImplementation | getDOMImplementation()Obtain an instance of a {@link DOMImplementation} object.
|
public javax.xml.validation.Schema | getSchema()Get a reference to the the {@link Schema} being used by
the XML processor.
If no schema is being used, null is returned.
throw new UnsupportedOperationException(
"This parser does not support specification \""
+ this.getClass().getPackage().getSpecificationTitle()
+ "\" version \""
+ this.getClass().getPackage().getSpecificationVersion()
+ "\""
);
|
public abstract boolean | isNamespaceAware()Indicates whether or not this parser is configured to
understand namespaces.
|
public abstract boolean | isValidating()Indicates whether or not this parser is configured to
validate XML documents.
|
public boolean | isXIncludeAware()Get the XInclude processing mode for this parser.
throw new UnsupportedOperationException(
"This parser does not support specification \""
+ this.getClass().getPackage().getSpecificationTitle()
+ "\" version \""
+ this.getClass().getPackage().getSpecificationVersion()
+ "\""
);
|
public abstract org.w3c.dom.Document | newDocument()Obtain a new instance of a DOM {@link Document} object
to build a DOM tree with.
|
public org.w3c.dom.Document | parse(java.io.InputStream is)Parse the content of the given InputStream as an XML
document and return a new DOM {@link Document} object.
An IllegalArgumentException is thrown if the
InputStream is null.
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource in = new InputSource(is);
return parse(in);
|
public org.w3c.dom.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 {@link Document} object.
An IllegalArgumentException is thrown if the
InputStream is null.
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource in = new InputSource(is);
in.setSystemId(systemId);
return parse(in);
|
public org.w3c.dom.Document | parse(java.lang.String uri)Parse the content of the given URI as an XML document
and return a new DOM {@link Document} object.
An IllegalArgumentException is thrown if the
URI is null null.
if (uri == null) {
throw new IllegalArgumentException("URI cannot be null");
}
InputSource in = new InputSource(uri);
return parse(in);
|
public org.w3c.dom.Document | parse(java.io.File f)Parse the content of the given file as an XML document
and return a new DOM {@link Document} object.
An IllegalArgumentException is thrown if the
File is null null.
if (f == null) {
throw new IllegalArgumentException("File cannot be null");
}
String uri = "file:" + f.getAbsolutePath();
if (File.separatorChar == '\\") {
uri = uri.replace('\\", '/");
}
InputSource in = new InputSource(uri);
return parse(in);
|
public abstract 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 {@link Document} object.
An IllegalArgumentException is thrown if the
InputSource is null null.
|
public void | reset()Reset this DocumentBuilder to its original configuration.
DocumentBuilder is reset to the same state as when it was created with
{@link DocumentBuilderFactory#newDocumentBuilder()}.
reset() is designed to allow the reuse of existing DocumentBuilder s
thus saving resources associated with the creation of new DocumentBuilder s.
The reset DocumentBuilder is not guaranteed to have the same {@link EntityResolver} or {@link ErrorHandler}
Object s, e.g. {@link Object#equals(Object obj)}. It is guaranteed to have a functionally equal
EntityResolver and ErrorHandler .
// implementors should override this method
throw new UnsupportedOperationException(
"This DocumentBuilder, \"" + this.getClass().getName() + "\", does not support the reset functionality."
+ " Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
+ " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
);
|
public abstract void | setEntityResolver(org.xml.sax.EntityResolver er)Specify the {@link 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(org.xml.sax.ErrorHandler eh)Specify the {@link ErrorHandler} to be used by the parser.
Setting this to null will result in the underlying
implementation using it's own default implementation and
behavior.
|