|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.xml.parsers.DocumentBuilderFactory org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
public class DocumentBuilderFactoryImpl
Constructor Summary | |
---|---|
DocumentBuilderFactoryImpl()
|
Method Summary | |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Allows the user to retrieve specific attributes on the underlying implementation. |
boolean |
getFeature(java.lang.String name)
Get the state of the named feature. |
Schema |
getSchema()
Gets the Schema object specified through
the DocumentBuilderFactory.setSchema(Schema schema) method. |
boolean |
isXIncludeAware()
Get state of XInclude processing. |
DocumentBuilder |
newDocumentBuilder()
Creates a new instance of a DocumentBuilder
using the currently configured parameters. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Allows the user to set specific attributes on the underlying implementation. |
void |
setFeature(java.lang.String name,
boolean value)
Set a feature for this DocumentBuilderFactory and DocumentBuilder s created by this factory. |
void |
setSchema(Schema grammar)
Set the Schema to be used by parsers created
from this factory. |
void |
setXIncludeAware(boolean state)
Set state of XInclude processing. |
Methods inherited from class javax.xml.parsers.DocumentBuilderFactory |
---|
isCoalescing, isExpandEntityReferences, isIgnoringComments, isIgnoringElementContentWhitespace, isNamespaceAware, isValidating, newInstance, setCoalescing, setExpandEntityReferences, setIgnoringComments, setIgnoringElementContentWhitespace, setNamespaceAware, setValidating |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentBuilderFactoryImpl()
Method Detail |
---|
public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
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(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
setAttribute
in class DocumentBuilderFactory
name
- name of attributevalue
- null means to remove attribute
java.lang.IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
getAttribute
in class DocumentBuilderFactory
name
- The name of the attribute.
java.lang.IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public Schema getSchema()
DocumentBuilderFactory
Schema
object specified through
the DocumentBuilderFactory.setSchema(Schema schema)
method.
getSchema
in class DocumentBuilderFactory
Schema
object that was last set through
the DocumentBuilderFactory.setSchema(Schema)
method, or null
if the method was not invoked since a SAXParserFactory
is created.public void setSchema(Schema grammar)
DocumentBuilderFactory
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 DOMErrorHandler
(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 DOMErrorHandler
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.
Initialy, null is set as the Schema
.
This processing will take effect even if
the DocumentBuilderFactory.isValidating()
method returns false.
It is an error to use
the http://java.sun.com/xml/jaxp/properties/schemaSource
property and/or the http://java.sun.com/xml/jaxp/properties/schemaLanguage
property in conjunction with a Schema
object.
Such configuration will cause a ParserConfigurationException
exception when the DocumentBuilderFactory.newDocumentBuilder()
is invoked.
A parser must be able to work with any Schema
implementation. However, parsers and schemas are allowed
to use implementation-specific custom mechanisms
as long as they yield the result described in the specification.
setSchema
in class DocumentBuilderFactory
grammar
- Schema
to use or null
to remove a schema.public boolean isXIncludeAware()
DocumentBuilderFactory
Get state of XInclude processing.
isXIncludeAware
in class DocumentBuilderFactory
public void setXIncludeAware(boolean state)
DocumentBuilderFactory
Set state of XInclude processing.
If XInclude markup is found in the document instance, should it be processed as specified in XML Inclusions (XInclude) Version 1.0.
XInclude processing defaults to false
.
setXIncludeAware
in class DocumentBuilderFactory
state
- Set XInclude processing to true
or
false
public boolean getFeature(java.lang.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 void setFeature(java.lang.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 enity 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |