Top Fields Constructors Methods
com.sun.org.apache.xerces.internal.jaxp

public Class DocumentBuilderFactoryImpl

extends DocumentBuilderFactory
Class Inheritance
Imports
com.sun.org.apache.xerces.internal.parsers.DOMParser, com.sun.org.apache.xerces.internal.util.SAXMessageFormatter, com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager, java.util.HashMap, .Map, javax.xml.XMLConstants, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, .ParserConfigurationException, javax.xml.validation.Schema, jdk.xml.internal.JdkProperty, .XMLSecurityManager, org.xml.sax.SAXException, .SAXNotRecognizedException, .SAXNotSupportedException

Authors
Rajiv Mordani, Edwin Goei

Field Summary

Modifier and TypeField and Description
private Map<String, Object>
attributes

These are DocumentBuilderFactory attributes not DOM attributes

private Map<String, Boolean>
private boolean
fSecureProcess

State of the secure processing feature, initially false

pack-priv XMLSecurityManager
pack-priv XMLSecurityPropertyManager
private Schema
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
getAttribute(String
The name of the attribute.
name
)

Implements abstract javax.xml.parsers.DocumentBuilderFactory.getAttribute.

Allows the user to retrieve specific attributes on the underlying implementation.

public boolean
getFeature(String
Feature name.
name
)

Implements abstract javax.xml.parsers.DocumentBuilderFactory.getFeature.

Get the state of the named feature.

public Schema
getSchema()

Overrides javax.xml.parsers.DocumentBuilderFactory.getSchema.

Gets the Schema object specified through the setSchema(Schema schema) method.

public boolean
isXIncludeAware()

Overrides javax.xml.parsers.DocumentBuilderFactory.isXIncludeAware.

Get state of XInclude processing.

public DocumentBuilder
newDocumentBuilder()

Implements abstract javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder.

Creates a new instance of a javax.xml.parsers.DocumentBuilder using the currently configured parameters.

public void
setAttribute(String
name of attribute
name
,
Object
null means to remove attribute
value
)

Implements abstract javax.xml.parsers.DocumentBuilderFactory.setAttribute.

Allows the user to set specific attributes on the underlying implementation.

public void
setFeature(String
Feature name.
name
,
boolean
Is feature state true or false.
value
)

Implements abstract javax.xml.parsers.DocumentBuilderFactory.setFeature.

Set a feature for this DocumentBuilderFactory and DocumentBuilders created by this factory.

public void
setSchema(Schema
Schema to use or null to remove a schema.
grammar
)

Overrides javax.xml.parsers.DocumentBuilderFactory.setSchema.

Set the Schema to be used by parsers created from this factory.

public void
setXIncludeAware(boolean
Set XInclude processing to true or false
state
)

Overrides javax.xml.parsers.DocumentBuilderFactory.setXIncludeAware.

Set state of XInclude processing.

Inherited from javax.xml.parsers.DocumentBuilderFactory:
isCoalescingisExpandEntityReferencesisIgnoringCommentsisIgnoringElementContentWhitespaceisNamespaceAwareisValidatingnewDefaultInstancenewDefaultNSInstancenewInstancenewInstancenewNSInstancenewNSInstancesetCoalescingsetExpandEntityReferencessetIgnoringCommentssetIgnoringElementContentWhitespacesetNamespaceAwaresetValidating

Field Detail

attributesback to summary
private Map<String, Object> attributes

These are DocumentBuilderFactory attributes not DOM attributes

featuresback to summary
private Map<String, Boolean> features
fSecureProcessback to summary
private boolean fSecureProcess

State of the secure processing feature, initially false

fSecurityManagerback to summary
pack-priv XMLSecurityManager fSecurityManager
fSecurityPropertyMgrback to summary
pack-priv XMLSecurityPropertyManager fSecurityPropertyMgr
grammarback to summary
private Schema grammar
isXIncludeAwareback to summary
private boolean isXIncludeAware

Constructor Detail

DocumentBuilderFactoryImplback to summary
public DocumentBuilderFactoryImpl()

Method Detail

getAttributeback to summary
public Object getAttribute(String name) throws IllegalArgumentException

Implements abstract javax.xml.parsers.DocumentBuilderFactory.getAttribute.

Allows the user to retrieve specific attributes on the underlying implementation.

Parameters
name:String

Doc from javax.xml.parsers.DocumentBuilderFactory.getAttribute.

The name of the attribute.

Returns:Object

Doc from javax.xml.parsers.DocumentBuilderFactory.getAttribute.

value The value of the attribute.

Exceptions
IllegalArgumentException:

Doc from javax.xml.parsers.DocumentBuilderFactory.getAttribute.

thrown if the underlying implementation doesn't recognize the attribute.

getFeatureback to summary
public boolean getFeature(String name) throws ParserConfigurationException

Implements abstract javax.xml.parsers.DocumentBuilderFactory.getFeature.

Doc from javax.xml.parsers.DocumentBuilderFactory.getFeature.

Get the state of the named feature.

Feature names are fully qualified java.net.URIs. Implementations may define their own features. An ParserConfigurationException is thrown if this DocumentBuilderFactory or the DocumentBuilders 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:String

Feature name.

Returns:boolean

State of the named feature.

Exceptions
ParserConfigurationException:
if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support this feature.
getSchemaback to summary
public Schema getSchema()

Overrides javax.xml.parsers.DocumentBuilderFactory.getSchema.

Doc from javax.xml.parsers.DocumentBuilderFactory.getSchema.

Gets the Schema object specified through the setSchema(Schema schema) method.

Returns:Schema

the Schema object that was last set through the setSchema(Schema) method, or null if the method was not invoked since a DocumentBuilderFactory is created.

isXIncludeAwareback to summary
public boolean isXIncludeAware()

Overrides javax.xml.parsers.DocumentBuilderFactory.isXIncludeAware.

Doc from javax.xml.parsers.DocumentBuilderFactory.isXIncludeAware.

Get state of XInclude processing.

Returns:boolean

current state of XInclude processing

newDocumentBuilderback to summary
public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException

Implements abstract javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder.

Creates a new instance of a javax.xml.parsers.DocumentBuilder using the currently configured parameters.

Returns:DocumentBuilder

Doc from javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder.

A new instance of a DocumentBuilder.

Exceptions
ParserConfigurationException:

Doc from javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder.

if a DocumentBuilder cannot be created which satisfies the configuration requested.

setAttributeback to summary
public void setAttribute(String name, Object value) throws IllegalArgumentException

Implements abstract javax.xml.parsers.DocumentBuilderFactory.setAttribute.

Allows the user to set specific attributes on the underlying implementation.

Parameters
name:String

name of attribute

value:Object

null means to remove attribute

Exceptions
IllegalArgumentException:

Doc from javax.xml.parsers.DocumentBuilderFactory.setAttribute.

thrown if the underlying implementation doesn't recognize the attribute.

setFeatureback to summary
public void setFeature(String name, boolean value) throws ParserConfigurationException

Implements abstract javax.xml.parsers.DocumentBuilderFactory.setFeature.

Doc from javax.xml.parsers.DocumentBuilderFactory.setFeature.

Set a feature for this DocumentBuilderFactory and DocumentBuilders created by this factory.

Feature names are fully qualified java.net.URIs. Implementations may define their own features. A ParserConfigurationException is thrown if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support the feature. It is possible for a DocumentBuilderFactory to expose a feature value but be unable to change its state.

All implementations are required to support the javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING feature. When the feature is:

Parameters
name:String

Feature name.

value:boolean

Is feature state true or false.

Annotations
@SuppressWarnings:removal
Exceptions
ParserConfigurationException:
if this DocumentBuilderFactory or the DocumentBuilders it creates cannot support this feature.
setSchemaback to summary
public void setSchema(Schema grammar)

Overrides javax.xml.parsers.DocumentBuilderFactory.setSchema.

Doc from javax.xml.parsers.DocumentBuilderFactory.setSchema.

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.

Initially, null is set as the Schema.

This processing will take effect even if the 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 newDocumentBuilder() is invoked.

Note for implementors

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.

Parameters
grammar:Schema

Schema to use or null to remove a schema.

setXIncludeAwareback to summary
public void setXIncludeAware(boolean state)

Overrides javax.xml.parsers.DocumentBuilderFactory.setXIncludeAware.

Doc from javax.xml.parsers.DocumentBuilderFactory.setXIncludeAware.

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.

Parameters
state:boolean

Set XInclude processing to true or false