|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.xml.parsers.DocumentBuilderFactory | +--org.apache.xerces.jaxp.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. |
javax.xml.validation.Schema |
getSchema()
Gets the Schema object specified through
the setSchema(Schema schema) method. |
boolean |
isXIncludeAware()
Get state of XInclude processing. |
javax.xml.parsers.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(javax.xml.validation.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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DocumentBuilderFactoryImpl()
Method Detail |
public javax.xml.parsers.DocumentBuilder newDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
DocumentBuilder
using the currently configured parameters.newDocumentBuilder
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.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 javax.xml.parsers.DocumentBuilderFactory
name
- name of attributevalue
- null means to remove attributepublic java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
getAttribute
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.DocumentBuilderFactory
name
- The name of the attribute.java.lang.IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public javax.xml.validation.Schema getSchema()
javax.xml.parsers.DocumentBuilderFactory
Schema
object specified through
the DocumentBuilderFactory.setSchema(Schema schema)
method.getSchema
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.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.UnsupportedOperationException
- For backward compatibility, when implementations for
earlier versions of JAXP is used, this exception will be
thrown.public void setSchema(javax.xml.validation.Schema grammar)
javax.xml.parsers.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 javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.DocumentBuilderFactory
schema
- Schema
to use or null
to remove a schema.UnsupportedOperationException
- For backward compatibility, when implementations for
earlier versions of JAXP is used, this exception will be
thrown.public boolean isXIncludeAware()
javax.xml.parsers.DocumentBuilderFactory
Get state of XInclude processing.
isXIncludeAware
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.DocumentBuilderFactory
UnsupportedOperationException
- For backward compatibility, when implementations for
earlier versions of JAXP is used, this exception will be
thrown.public void setXIncludeAware(boolean state)
javax.xml.parsers.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 javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.DocumentBuilderFactory
state
- Set XInclude processing to true
or
false
UnsupportedOperationException
- For backward compatibility, when implementations for
earlier versions of JAXP is used, this exception will be
thrown.public boolean getFeature(java.lang.String name) throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.DocumentBuilderFactory
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.
getFeature
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.DocumentBuilderFactory
name
- Feature name.javax.xml.parsers.ParserConfigurationException
- if this DocumentBuilderFactory
or the DocumentBuilder
s it creates cannot support this feature.public void setFeature(java.lang.String name, boolean value) throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.DocumentBuilderFactory
Set a feature for this DocumentBuilderFactory
and DocumentBuilder
s created by this factory.
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.
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 javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.DocumentBuilderFactory
name
- Feature name.value
- Is feature state true
or false
.javax.xml.parsers.ParserConfigurationException
- if this DocumentBuilderFactory
or the DocumentBuilder
s
it creates cannot support this feature.NullPointerException
- If the name
parameter is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |