public class

DOMConfigurationImpl

extends ParserConfigurationSettings
implements XMLParserConfiguration DOMConfiguration
java.lang.Object
   ↳ org.apache.xerces.util.ParserConfigurationSettings
     ↳ org.apache.xerces.dom.DOMConfigurationImpl

Class Overview

Xerces implementation of DOMConfiguration that maintains a table of recognized parameters.@xerces.internal

Summary

Constants
String BALANCE_SYNTAX_TREES Feature identifier: balance syntax trees.
short CDATA
short COMMENTS
String DISALLOW_DOCTYPE_DECL_FEATURE Feature identifier: load external DTD.
String DTD_VALIDATOR_FACTORY_PROPERTY Property identifier: datatype validator factory.
String DTD_VALIDATOR_PROPERTY Property identifier: DTD validator.
short DTNORMALIZATION
String DYNAMIC_VALIDATION
short ENTITIES
String ENTITY_MANAGER Property identifier: entity manager.
String ENTITY_RESOLVER Property identifier: entity resolver.
String ERROR_HANDLER Property identifier: error handler.
String ERROR_REPORTER Property identifier: error reporter.
String GENERATE_SYNTHETIC_ANNOTATIONS Feature: generate synthetic annotations
String GRAMMAR_POOL Property id: Grammar pool
String HONOUR_ALL_SCHEMALOCATIONS Feature identifier: honour all schemaLocations
short INFOSET_FALSE_PARAMS
short INFOSET_MASK
short INFOSET_TRUE_PARAMS
String JAXP_SCHEMA_LANGUAGE Property identifier: JAXP schema language / DOM schema-type.
String JAXP_SCHEMA_SOURCE Property identifier: JAXP schema source/ DOM schema-location.
short NAMESPACES
String NORMALIZE_DATA
short NSDECL
short PSVI
String SCHEMA
String SCHEMA_ELEMENT_DEFAULT Feature identifier: send element default value via characters()
String SCHEMA_FULL_CHECKING
String SCHEMA_LOCATION Property identifier: schema location.
String SCHEMA_NONS_LOCATION Property identifier: no namespace schema location.
String SEND_PSVI sending psvi in the pipeline
short SPLITCDATA
String SYMBOL_TABLE Property identifier: symbol table.
String USE_GRAMMAR_POOL_ONLY Feature identifier: use grammar pool only
short VALIDATE
String VALIDATE_ANNOTATIONS Feature identifier: validate annotations
String VALIDATION_MANAGER
String WARN_ON_DUPLICATE_ATTDEF Feature identifier: warn on duplicate attribute definition.
short WELLFORMED
String XERCES_NAMESPACES Feature identifier: namespaces.
String XERCES_VALIDATION Feature identifier: validation.
String XML11_DATATYPE_VALIDATOR_FACTORY
String XML_STRING Property identifier: xml string.
[Expand]
Inherited Constants
From class org.apache.xerces.util.ParserConfigurationSettings
Fields
protected ArrayList fComponents Components.
protected DTDDVFactory fCurrentDVFactory Current Datatype validator factory.
protected DTDDVFactory fDatatypeValidatorFactory The XML 1.0 Datatype validator factory.
protected final DOMErrorHandlerWrapper fErrorHandlerWrapper
protected XMLErrorReporter fErrorReporter Error reporter
protected Locale fLocale Locale.
protected SymbolTable fSymbolTable Symbol table.
protected ValidationManager fValidationManager
protected DTDDVFactory fXML11DatatypeFactory The XML 1.1 Datatype validator factory.
protected short features Normalization features
[Expand]
Inherited Fields
From class org.apache.xerces.util.ParserConfigurationSettings
Protected Constructors
DOMConfigurationImpl()
Default Constructor.
DOMConfigurationImpl(SymbolTable symbolTable)
Constructs a parser configuration using the specified symbol table.
DOMConfigurationImpl(SymbolTable symbolTable, XMLComponentManager parentSettings)
Constructs a parser configuration using the specified symbol table and parent settings.
Public Methods
boolean canSetParameter(String name, Object value)
DOM Level 3 WD - Experimental.
XMLDTDContentModelHandler getDTDContentModelHandler()
Returns the registered DTD content model handler.
XMLDTDHandler getDTDHandler()
Returns the registered DTD handler.
XMLDocumentHandler getDocumentHandler()
Returns the registered document handler.
XMLEntityResolver getEntityResolver()
Return the current entity resolver.
XMLErrorHandler getErrorHandler()
Return the current error handler.
boolean getFeature(String featureId)
Returns the state of a feature.
Locale getLocale()
Returns the locale.
Object getParameter(String name)
DOM Level 3 WD - Experimental.
DOMStringList getParameterNames()
DOM Level 3 CR - Experimental.
void parse(XMLInputSource inputSource)
Parse an XML document.
void setDTDContentModelHandler(XMLDTDContentModelHandler handler)
Sets the DTD content model handler.
void setDTDHandler(XMLDTDHandler dtdHandler)
Sets the DTD handler.
void setDocumentHandler(XMLDocumentHandler documentHandler)
Sets the document handler on the last component in the pipeline to receive information about the document.
void setEntityResolver(XMLEntityResolver resolver)
Sets the resolver used to resolve external entities.
void setErrorHandler(XMLErrorHandler errorHandler)
Allow an application to register an error event handler.
void setFeature(String featureId, boolean state)
Set the state of a feature.
void setLocale(Locale locale)
Set the locale to use for messages.
void setParameter(String name, Object value)
DOM Level 3 WD - Experimental.
void setProperty(String propertyId, Object value)
setProperty
Protected Methods
void addComponent(XMLComponent component)
void checkProperty(String propertyId)
Check a property.
ValidationManager createValidationManager()
void reset()
reset all components before parsing
final void setDTDValidatorFactory(String version)
[Expand]
Inherited Methods
From class org.apache.xerces.util.ParserConfigurationSettings
From class java.lang.Object
From interface org.apache.xerces.xni.parser.XMLComponentManager
From interface org.apache.xerces.xni.parser.XMLParserConfiguration
From interface org.w3c.dom.DOMConfiguration

Constants

protected static final String BALANCE_SYNTAX_TREES

Feature identifier: balance syntax trees.

Constant Value: "http://apache.org/xml/features/validation/balance-syntax-trees"

protected static final short CDATA

Constant Value: 8 (0x00000008)

protected static final short COMMENTS

Constant Value: 32 (0x00000020)

protected static final String DISALLOW_DOCTYPE_DECL_FEATURE

Feature identifier: load external DTD.

Constant Value: "http://apache.org/xml/features/disallow-doctype-decl"

protected static final String DTD_VALIDATOR_FACTORY_PROPERTY

Property identifier: datatype validator factory.

Constant Value: "http://apache.org/xml/properties/internal/datatype-validator-factory"

protected static final String DTD_VALIDATOR_PROPERTY

Property identifier: DTD validator.

Constant Value: "http://apache.org/xml/properties/internal/validator/dtd"

protected static final short DTNORMALIZATION

Constant Value: 2 (0x00000002)

protected static final String DYNAMIC_VALIDATION

Constant Value: "http://apache.org/xml/features/validation/dynamic"

protected static final short ENTITIES

Constant Value: 4 (0x00000004)

protected static final String ENTITY_MANAGER

Property identifier: entity manager.

Constant Value: "http://apache.org/xml/properties/internal/entity-manager"

protected static final String ENTITY_RESOLVER

Property identifier: entity resolver.

Constant Value: "http://apache.org/xml/properties/internal/entity-resolver"

protected static final String ERROR_HANDLER

Property identifier: error handler.

Constant Value: "http://apache.org/xml/properties/internal/error-handler"

protected static final String ERROR_REPORTER

Property identifier: error reporter.

Constant Value: "http://apache.org/xml/properties/internal/error-reporter"

protected static final String GENERATE_SYNTHETIC_ANNOTATIONS

Feature: generate synthetic annotations

Constant Value: "http://apache.org/xml/features/generate-synthetic-annotations"

protected static final String GRAMMAR_POOL

Property id: Grammar pool

Constant Value: "http://apache.org/xml/properties/internal/grammar-pool"

protected static final String HONOUR_ALL_SCHEMALOCATIONS

Feature identifier: honour all schemaLocations

Constant Value: "http://apache.org/xml/features/honour-all-schemaLocations"

protected static final short INFOSET_FALSE_PARAMS

Constant Value: 14 (0x0000000e)

protected static final short INFOSET_MASK

Constant Value: 815 (0x0000032f)

protected static final short INFOSET_TRUE_PARAMS

Constant Value: 801 (0x00000321)

protected static final String JAXP_SCHEMA_LANGUAGE

Property identifier: JAXP schema language / DOM schema-type.

Constant Value: "http://java.sun.com/xml/jaxp/properties/schemaLanguage"

protected static final String JAXP_SCHEMA_SOURCE

Property identifier: JAXP schema source/ DOM schema-location.

Constant Value: "http://java.sun.com/xml/jaxp/properties/schemaSource"

protected static final short NAMESPACES

Constant Value: 1 (0x00000001)

protected static final String NORMALIZE_DATA

Constant Value: "http://apache.org/xml/features/validation/schema/normalized-value"

protected static final short NSDECL

Constant Value: 512 (0x00000200)

protected static final short PSVI

Constant Value: 128 (0x00000080)

protected static final String SCHEMA

Constant Value: "http://apache.org/xml/features/validation/schema"

protected static final String SCHEMA_ELEMENT_DEFAULT

Feature identifier: send element default value via characters()

Constant Value: "http://apache.org/xml/features/validation/schema/element-default"

protected static final String SCHEMA_FULL_CHECKING

Constant Value: "http://apache.org/xml/features/validation/schema-full-checking"

protected static final String SCHEMA_LOCATION

Property identifier: schema location.

Constant Value: "http://apache.org/xml/properties/schema/external-schemaLocation"

protected static final String SCHEMA_NONS_LOCATION

Property identifier: no namespace schema location.

Constant Value: "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"

protected static final String SEND_PSVI

sending psvi in the pipeline

Constant Value: "http://apache.org/xml/features/validation/schema/augment-psvi"

protected static final short SPLITCDATA

Constant Value: 16 (0x00000010)

protected static final String SYMBOL_TABLE

Property identifier: symbol table.

Constant Value: "http://apache.org/xml/properties/internal/symbol-table"

protected static final String USE_GRAMMAR_POOL_ONLY

Feature identifier: use grammar pool only

Constant Value: "http://apache.org/xml/features/internal/validation/schema/use-grammar-pool-only"

protected static final short VALIDATE

Constant Value: 64 (0x00000040)

protected static final String VALIDATE_ANNOTATIONS

Feature identifier: validate annotations

Constant Value: "http://apache.org/xml/features/validate-annotations"

protected static final String VALIDATION_MANAGER

Constant Value: "http://apache.org/xml/properties/internal/validation-manager"

protected static final String WARN_ON_DUPLICATE_ATTDEF

Feature identifier: warn on duplicate attribute definition.

Constant Value: "http://apache.org/xml/features/validation/warn-on-duplicate-attdef"

protected static final short WELLFORMED

Constant Value: 256 (0x00000100)

protected static final String XERCES_NAMESPACES

Feature identifier: namespaces.

Constant Value: "http://xml.org/sax/features/namespaces"

protected static final String XERCES_VALIDATION

Feature identifier: validation.

Constant Value: "http://xml.org/sax/features/validation"

protected static final String XML11_DATATYPE_VALIDATOR_FACTORY

Constant Value: "org.apache.xerces.impl.dv.dtd.XML11DTDDVFactoryImpl"

protected static final String XML_STRING

Property identifier: xml string.

Constant Value: "http://xml.org/sax/properties/xml-string"

Fields

protected ArrayList fComponents

Components.

protected DTDDVFactory fCurrentDVFactory

Current Datatype validator factory.

protected DTDDVFactory fDatatypeValidatorFactory

The XML 1.0 Datatype validator factory.

protected final DOMErrorHandlerWrapper fErrorHandlerWrapper

protected XMLErrorReporter fErrorReporter

Error reporter

protected Locale fLocale

Locale.

protected SymbolTable fSymbolTable

Symbol table.

protected ValidationManager fValidationManager

protected DTDDVFactory fXML11DatatypeFactory

The XML 1.1 Datatype validator factory.

protected short features

Normalization features

Protected Constructors

protected DOMConfigurationImpl ()

Default Constructor.

protected DOMConfigurationImpl (SymbolTable symbolTable)

Constructs a parser configuration using the specified symbol table.

Parameters
symbolTable The symbol table to use.

protected DOMConfigurationImpl (SymbolTable symbolTable, XMLComponentManager parentSettings)

Constructs a parser configuration using the specified symbol table and parent settings.

Parameters
symbolTable The symbol table to use.
parentSettings The parent settings.

Public Methods

public boolean canSetParameter (String name, Object value)

DOM Level 3 WD - Experimental. Check if setting a parameter to a specific value is supported.

Parameters
name The name of the parameter to check.
value An object. if null, the returned value is true.
Returns
  • true if the parameter could be successfully set to the specified value, or false if the parameter is not recognized or the requested value is not supported. This does not change the current value of the parameter itself.

public XMLDTDContentModelHandler getDTDContentModelHandler ()

Returns the registered DTD content model handler.

public XMLDTDHandler getDTDHandler ()

Returns the registered DTD handler.

public XMLDocumentHandler getDocumentHandler ()

Returns the registered document handler.

public XMLEntityResolver getEntityResolver ()

Return the current entity resolver.

Returns
  • The current entity resolver, or null if none has been registered.

public XMLErrorHandler getErrorHandler ()

Return the current error handler.

Returns
  • The current error handler, or null if none has been registered.

public boolean getFeature (String featureId)

Returns the state of a feature.

Parameters
featureId The feature identifier.
Returns
  • true if the feature is supported
Throws
XMLConfigurationException Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

public Locale getLocale ()

Returns the locale.

public Object getParameter (String name)

DOM Level 3 WD - Experimental. getParameter

Throws
DOMException

public DOMStringList getParameterNames ()

DOM Level 3 CR - Experimental. The list of the parameters supported by this DOMConfiguration object and for which at least one value can be set by the application. Note that this list can also contain parameter names defined outside this specification.

public void parse (XMLInputSource inputSource)

Parse an XML document.

The parser can use this method to instruct this configuration to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Parsers may not invoke this method while a parse is in progress. Once a parse is complete, the parser may then parse another XML document.

This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.

Parameters
inputSource The input source for the top-level of the XML document.
Throws
XNIException Any XNI exception, possibly wrapping another exception.
IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the parser.

public void setDTDContentModelHandler (XMLDTDContentModelHandler handler)

Sets the DTD content model handler.

Parameters
handler The DTD content model handler.

public void setDTDHandler (XMLDTDHandler dtdHandler)

Sets the DTD handler.

Parameters
dtdHandler The DTD handler.

public void setDocumentHandler (XMLDocumentHandler documentHandler)

Sets the document handler on the last component in the pipeline to receive information about the document.

Parameters
documentHandler The document handler.

public void setEntityResolver (XMLEntityResolver resolver)

Sets the resolver used to resolve external entities. The EntityResolver interface supports resolution of public and system identifiers.

Parameters
resolver The new entity resolver. Passing a null value will uninstall the currently installed resolver.

public void setErrorHandler (XMLErrorHandler errorHandler)

Allow an application to register an error event handler.

If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters
errorHandler The error handler.
Throws
NullPointerException If the handler argument is null.

public void setFeature (String featureId, boolean state)

Set the state of a feature. Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.

Parameters
featureId The unique identifier (URI) of the feature.
state The requested state of the feature (true or false).
Throws
XMLConfigurationException If the requested feature is not known.

public void setLocale (Locale locale)

Set the locale to use for messages.

Parameters
locale The locale object to use for localization of messages.
Throws
XNIException Thrown if the parser does not support the specified locale.

public void setParameter (String name, Object value)

DOM Level 3 WD - Experimental. setParameter

Throws
DOMException

public void setProperty (String propertyId, Object value)

setProperty

Protected Methods

protected void addComponent (XMLComponent component)

protected void checkProperty (String propertyId)

Check a property. If the property is known and supported, this method simply returns. Otherwise, the appropriate exception is thrown.

Parameters
propertyId The unique identifier (URI) of the property being set.
Throws
XMLConfigurationException If the requested feature is not known or supported.

protected ValidationManager createValidationManager ()

protected void reset ()

reset all components before parsing

Throws
XNIException

protected final void setDTDValidatorFactory (String version)