This class uses another DocumentBuilderFactory implementation and adds the validation capability to it.
| Modifier and Type | Field and Description |
|---|---|
| private final DocumentBuilderFactory | core
Wrapped DocumentBuilderFactory that does everything else. |
| private final VerifierFactory | jarvFactory
JARV VerifierFactory implementation, which will be used to parse schemas. |
| private Schema | schema
The validation will be performed against this schema object. |
| Access | Constructor and Description |
|---|---|
| public | DocumentBuilderFactoryImpl()
Creates a new instance by using the default DocumentBuilderFactory implementation as the underlying parser. |
| public | DocumentBuilderFactoryImpl(DocumentBuilderFactory _factory)
Creates a new instance by specifying the underlying SAXParserFactory implementation. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getAttribute(String
The name of the attribute. name)Implements abstract javax. |
| public boolean | getFeature(String
Feature name. name)Implements abstract javax. |
| public boolean | isCoalescing()
Overrides javax. |
| public boolean | |
| public boolean | isIgnoringComments()
Overrides javax. |
| public boolean | isIgnoringElementContentWhitespace()
Overrides javax. |
| public boolean | isNamespaceAware()
Overrides javax. |
| public boolean | isValidating()
Overrides javax. |
| public DocumentBuilder | newDocumentBuilder()
Implements abstract javax. javax.xml.parsers.DocumentBuilder
using the currently configured parameters.
|
| public void | setAttribute(String
The name of the attribute. name, Object The value of the attribute. value)Implements abstract javax. |
| public void | setCoalescing(boolean
true if the parser produced will convert CDATA nodes
to Text nodes and append it to the adjacent (if any)
text node; false otherwise. newVal)Overrides javax. |
| public void | |
| public void | setFeature(String
Feature name. name, boolean Is feature state value)true or false.Implements abstract javax. DocumentBuilderFactory
and DocumentBuilders created by this factory.
|
| public void | setIgnoringComments(boolean
boolean value to ignore comments during processingOverrides javax. |
| public void | setIgnoringElementContentWhitespace(boolean
true if the parser created must eliminate whitespace
in the element content when parsing XML documents;
false otherwise. newVal)Overrides javax. |
| public void | setNamespaceAware(boolean
true if the parser produced will provide support
for XML namespaces; false otherwise. newVal)Overrides javax. |
| public void | setValidating(boolean
true if the parser produced will validate documents
as they are parsed; false otherwise. newVal)Overrides javax. |
| core | back to summary |
|---|---|
| private final DocumentBuilderFactory core Wrapped DocumentBuilderFactory that does everything else. | |
| jarvFactory | back to summary |
|---|---|
| private final VerifierFactory jarvFactory JARV VerifierFactory implementation, which will be used to parse schemas. | |
| schema | back to summary |
|---|---|
| private Schema schema The validation will be performed against this schema object. | |
| DocumentBuilderFactoryImpl | back to summary |
|---|---|
| public DocumentBuilderFactoryImpl() Creates a new instance by using the default DocumentBuilderFactory implementation as the underlying parser. This constructor does not set any schema. | |
| DocumentBuilderFactoryImpl | back to summary |
|---|---|
| public DocumentBuilderFactoryImpl(DocumentBuilderFactory _factory) Creates a new instance by specifying the underlying SAXParserFactory implementation. This constructor does not set any schema. | |
| DocumentBuilderFactoryImpl | back to summary |
|---|---|
| public DocumentBuilderFactoryImpl(DocumentBuilderFactory _factory, Schema _schema) | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name) Implements abstract javax. Doc from javax. Allows the user to retrieve specific attributes on the underlying implementation. | |
| getFeature | back to summary |
|---|---|
| public boolean getFeature(String name) Implements abstract javax. Doc from javax. Get the state of the named feature.
Feature names are fully qualified
| |
| isCoalescing | back to summary |
|---|---|
| public boolean isCoalescing() Overrides javax. Doc from javax. 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.
| |
| isExpandEntityReference | back to summary |
|---|---|
| public boolean isExpandEntityReference() | |
| isIgnoringComments | back to summary |
|---|---|
| public boolean isIgnoringComments() Overrides javax. Doc from javax. Indicates whether or not the factory is configured to produce parsers which ignores comments.
| |
| isIgnoringElementContentWhitespace | back to summary |
|---|---|
| public boolean isIgnoringElementContentWhitespace() Overrides javax. Doc from javax. Indicates whether or not the factory is configured to produce parsers which ignore ignorable whitespace in element content.
| |
| isNamespaceAware | back to summary |
|---|---|
| public boolean isNamespaceAware() Overrides javax. Doc from javax. Indicates whether or not the factory is configured to produce parsers which are namespace aware.
| |
| isValidating | back to summary |
|---|---|
| public boolean isValidating() Overrides javax. Doc from javax. Indicates whether or not the factory is configured to produce parsers which validate the XML content during parse.
| |
| newDocumentBuilder | back to summary |
|---|---|
| public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException Implements abstract javax. Doc from javax. Creates a new instance of a
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(String name, Object value) Implements abstract javax. Doc from javax. Allows the user to set specific attributes on the underlying implementation.
All implementations that implement JAXP 1.5 or newer are required to
support the
| |
| setCoalescing | back to summary |
|---|---|
| public void setCoalescing(boolean newVal) Overrides javax. Doc from javax. 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. By default the value of this is set to
| |
| setExpandEntityReference | back to summary |
|---|---|
| public void setExpandEntityReference(boolean newVal) | |
| setFeature | back to summary |
|---|---|
| public void setFeature(String name, boolean value) Implements abstract javax. Doc from javax. Set a feature for this
Feature names are fully qualified
All implementations are required to support the
| |
| setIgnoringComments | back to summary |
|---|---|
| public void setIgnoringComments(boolean newVal) Overrides javax. Doc from javax. Specifies that the parser produced by this code will
ignore comments. By default the value of this is set to
| |
| setIgnoringElementContentWhitespace | back to summary |
|---|---|
| public void setIgnoringElementContentWhitespace(boolean newVal) Overrides javax. Doc from javax. 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). Note that only whitespace which is directly contained within
element content that has an element only content model (see XML
Rec 3.2.1) will be eliminated. Due to reliance on the content model
this setting requires the parser to be in validating mode. By default
the value of this is set to
| |
| setNamespaceAware | back to summary |
|---|---|
| public void setNamespaceAware(boolean newVal) Overrides javax. Doc from javax. Specifies that the parser produced by this code will
provide support for XML namespaces. By default the value of this is set
to
| |
| setValidating | back to summary |
|---|---|
| public void setValidating(boolean newVal) Overrides javax. Doc from javax. Specifies that the parser produced by this code will
validate documents as they are parsed. By default the value of this
is set to Note that "the validation" here means a validating parser as defined in the XML recommendation. In other words, it essentially just controls the DTD validation. (except the legacy two properties defined in JAXP 1.2.)
To use modern schema languages such as W3C XML Schema or
RELAX NG instead of DTD, you can configure your parser to be
a non-validating parser by leaving the
| |