public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory
Constructor and Description |
---|
DocumentBuilderFactoryImpl() |
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String name)
Allows the user to retrieve specific attributes on the underlying
implementation.
|
boolean |
getFeature(String name)
Get the state of the named feature.
|
DocumentBuilder |
newDocumentBuilder()
Creates a new instance of a
DocumentBuilder
using the currently configured parameters. |
void |
setAttribute(String name,
Object value)
Allows the user to set specific attributes on the underlying
implementation.
|
void |
setFeature(String name,
boolean value)
Set a feature for this
DocumentBuilderFactory and DocumentBuilder s created by this factory. |
getSchema, isCoalescing, isExpandEntityReferences, isIgnoringComments, isIgnoringElementContentWhitespace, isNamespaceAware, isValidating, isXIncludeAware, newInstance, newInstance, setCoalescing, setExpandEntityReferences, setIgnoringComments, setIgnoringElementContentWhitespace, setNamespaceAware, setSchema, setValidating, setXIncludeAware
public Object getAttribute(String name) throws IllegalArgumentException
DocumentBuilderFactory
getAttribute
in class DocumentBuilderFactory
name
- The name of the attribute.IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public boolean getFeature(String name) throws ParserConfigurationException
DocumentBuilderFactory
Get the state of the named feature.
Feature names are fully qualified 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.
getFeature
in class DocumentBuilderFactory
name
- Feature name.ParserConfigurationException
- if this DocumentBuilderFactory
or the DocumentBuilder
s it creates cannot support this feature.public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
DocumentBuilderFactory
DocumentBuilder
using the currently configured parameters.newDocumentBuilder
in class DocumentBuilderFactory
ParserConfigurationException
- if a DocumentBuilder
cannot be created which satisfies the configuration requested.public void setAttribute(String name, Object value) throws IllegalArgumentException
DocumentBuilderFactory
setAttribute
in class DocumentBuilderFactory
name
- The name of the attribute.value
- The value of the attribute.IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public void setFeature(String name, boolean value) throws ParserConfigurationException
DocumentBuilderFactory
Set a feature for this DocumentBuilderFactory
and DocumentBuilder
s created by this factory.
Feature names are fully qualified 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.
All implementations are required to support the XMLConstants.FEATURE_SECURE_PROCESSING
feature.
When the feature is:
true
: the implementation will limit XML processing to conform to implementation limits.
Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
If XML processing is limited for security reasons, it will be reported via a call to the registered
ErrorHandler.fatalError(SAXParseException exception)
.
See DocumentBuilder.setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
.
false
: the implementation will processing XML according to the XML specifications without
regard to possible implementation limits.
setFeature
in class DocumentBuilderFactory
name
- Feature name.value
- Is feature state true
or false
.ParserConfigurationException
- if this DocumentBuilderFactory
or the DocumentBuilder
s
it creates cannot support this feature.