Method Summary |
|
abstract public Object | getAttribute(String name) Allows the user to retrieve specific attributes on the underlying
implementation.
Parameters: name - The name of the attribute. |
abstract public boolean | getFeature(String name) Get the state of the named feature.
Feature names are fully qualified
java.net.URI s.
Implementations may define their own features.
An
ParserConfigurationException is thrown if this DocumentBuilderFactory or the
DocumentBuilder s it creates cannot support the feature.
It is possible for an DocumentBuilderFactory to expose a feature value but be unable to change its state.
Parameters: name - Feature name. |
public Schema | getSchema() Gets the
Schema object specified through
the
DocumentBuilderFactory.setSchema(Schema schema) method. |
public boolean | isCoalescing() Indicates whether or not the factory is configured to produce
parsers which converts CDATA nodes to Text nodes and appends it to
the adjacent (if any) Text node. |
public boolean | isExpandEntityReferences() Indicates whether or not the factory is configured to produce
parsers which expand entity reference nodes. |
public boolean | isIgnoringComments() Indicates whether or not the factory is configured to produce
parsers which ignores comments. |
public boolean | isIgnoringElementContentWhitespace() Indicates whether or not the factory is configured to produce
parsers which ignore ignorable whitespace in element content. |
public boolean | isNamespaceAware() Indicates whether or not the factory is configured to produce
parsers which are namespace aware. |
public boolean | isValidating() Indicates whether or not the factory is configured to produce
parsers which validate the XML content during parse. |
public boolean | isXIncludeAware() |
abstract public DocumentBuilder | newDocumentBuilder() Creates a new instance of a
javax.xml.parsers.DocumentBuilder using the currently configured parameters. |
public static DocumentBuilderFactory | newInstance() Obtain a new instance of a
DocumentBuilderFactory . |
public static DocumentBuilderFactory | newInstance(String factoryClassName, ClassLoader classLoader) Obtain a new instance of a DocumentBuilderFactory from class name.
This function is useful when there are multiple providers in the classpath.
It gives more control to the application as it can specify which provider
should be loaded.
Once an application has obtained a reference to a DocumentBuilderFactory
it can use the factory to configure and obtain parser instances.
Tip for Trouble-shooting
Setting the jaxp.debug system property will cause
this method to print a lot of debug messages
to System.err about what it is doing and where it is looking at.
If you have problems try:
java -Djaxp.debug=1 YourProgram ....
Parameters: factoryClassName - fully qualified factory class name that provides implementation of javax.xml.parsers.DocumentBuilderFactory . Parameters: classLoader - ClassLoader used to load the factory class. |
abstract public void | setAttribute(String name, Object value) Allows the user to set specific attributes on the underlying
implementation. |
public void | setCoalescing(boolean coalescing) Specifies that the parser produced by this code will
convert CDATA nodes to Text nodes and append it to the
adjacent (if any) text node. |
public void | setExpandEntityReferences(boolean expandEntityRef) Specifies that the parser produced by this code will
expand entity reference nodes. |
abstract public void | setFeature(String name, boolean value) Set a feature for this DocumentBuilderFactory and DocumentBuilder s created by this factory.
Feature names are fully qualified
java.net.URI s. |
public void | setIgnoringComments(boolean ignoreComments) Specifies that the parser produced by this code will
ignore comments. |
public void | setIgnoringElementContentWhitespace(boolean whitespace) Specifies that the parsers created by this factory must eliminate
whitespace in element content (sometimes known loosely as
'ignorable whitespace') when parsing XML documents (see XML Rec
2.10). |
public void | setNamespaceAware(boolean awareness) Specifies that the parser produced by this code will
provide support for XML namespaces. |
public void | setSchema(Schema schema) Set the
Schema to be used by parsers created
from this factory.
When a
Schema is non-null, a parser will use a validator
created from it to validate documents before it passes information
down to the application.
When errors are found by the validator, the parser is responsible
to report them to the user-specified
org.xml.sax.ErrorHandler (or if the error handler is not set, ignore them or throw them), just
like any other errors found by the parser itself.
In other words, if the user-specified
org.xml.sax.ErrorHandler is set, it must receive those errors, and if not, they must be
treated according to the implementation specific
default error handling rules.
A validator may modify the outcome of a parse (for example by
adding default values that were missing in documents), and a parser
is responsible to make sure that the application will receive
modified DOM trees. |
public void | setValidating(boolean validating) Specifies that the parser produced by this code will
validate documents as they are parsed. |
public void | setXIncludeAware(boolean state) |