org.apache.xerces.dom

Class DOMConfigurationImpl

public class DOMConfigurationImpl extends ParserConfigurationSettings implements XMLParserConfiguration, DOMConfiguration

Xerces implementation of DOMConfiguration that maintains a table of recognized parameters.

Version: $Id: DOMConfigurationImpl.java,v 1.36 2005/07/25 04:24:21 mrglavas Exp $

Author: Elena Litani, IBM Neeraj Bajaj, Sun Microsystems.

UNKNOWN:

Field Summary
protected static shortCDATA
protected static shortCOMMENTS
protected static StringDTD_VALIDATOR_FACTORY_PROPERTY
protected static shortDTNORMALIZATION
protected static StringDYNAMIC_VALIDATION
protected static shortENTITIES
protected static StringENTITY_MANAGER
Property identifier: entity manager.
protected static StringENTITY_RESOLVER
Property identifier: entity resolver.
protected static StringERROR_HANDLER
Property identifier: error handler.
protected static StringERROR_REPORTER
Property identifier: error reporter.
protected ArrayListfComponents
Components.
protected shortfeatures
Normalization features
protected DOMErrorHandlerWrapperfErrorHandlerWrapper
protected XMLErrorReporterfErrorReporter
Error reporter
protected LocalefLocale
Locale.
protected SymbolTablefSymbolTable
Symbol table.
protected ValidationManagerfValidationManager
protected static StringGRAMMAR_POOL
Property id: Grammar pool
protected static shortINFOSET_FALSE_PARAMS
protected static shortINFOSET_MASK
protected static shortINFOSET_TRUE_PARAMS
protected static StringJAXP_SCHEMA_LANGUAGE
Property identifier: JAXP schema language / DOM schema-type.
protected static StringJAXP_SCHEMA_SOURCE
Property identifier: JAXP schema source/ DOM schema-location.
protected static shortNAMESPACES
protected static StringNORMALIZE_DATA
protected static shortNSDECL
protected static shortPSVI
protected static StringSCHEMA
protected static StringSCHEMA_FULL_CHECKING
protected static StringSEND_PSVI
sending psvi in the pipeline
protected static shortSPLITCDATA
protected static StringSYMBOL_TABLE
Property identifier: symbol table.
protected static shortVALIDATE
protected static StringVALIDATION_MANAGER
protected static shortWELLFORMED
protected static StringXERCES_NAMESPACES
Feature identifier: namespaces.
protected static StringXERCES_VALIDATION
Feature identifier: validation.
protected static StringXML_STRING
Property identifier: xml string.
Constructor Summary
protected DOMConfigurationImpl()
Default Constructor.
protected DOMConfigurationImpl(SymbolTable symbolTable)
Constructs a parser configuration using the specified symbol table.
protected DOMConfigurationImpl(SymbolTable symbolTable, XMLComponentManager parentSettings)
Constructs a parser configuration using the specified symbol table and parent settings.
Method Summary
protected voidaddComponent(XMLComponent component)
booleancanSetParameter(String name, Object value)
DOM Level 3 WD - Experimental.
protected voidcheckProperty(String propertyId)
Check a property.
protected ValidationManagercreateValidationManager()
XMLDocumentHandlergetDocumentHandler()
Returns the registered document handler.
XMLDTDContentModelHandlergetDTDContentModelHandler()
Returns the registered DTD content model handler.
XMLDTDHandlergetDTDHandler()
Returns the registered DTD handler.
XMLEntityResolvergetEntityResolver()
Return the current entity resolver.
XMLErrorHandlergetErrorHandler()
Return the current error handler.
LocalegetLocale()
Returns the locale.
ObjectgetParameter(String name)
DOM Level 3 WD - Experimental. getParameter
DOMStringListgetParameterNames()
DOM Level 3 CR - Experimental.
voidparse(XMLInputSource inputSource)
Parse an XML document.
protected voidreset()
reset all components before parsing
voidsetDocumentHandler(XMLDocumentHandler documentHandler)
Sets the document handler on the last component in the pipeline to receive information about the document.
voidsetDTDContentModelHandler(XMLDTDContentModelHandler handler)
Sets the DTD content model handler.
voidsetDTDHandler(XMLDTDHandler dtdHandler)
Sets the DTD handler.
voidsetEntityResolver(XMLEntityResolver resolver)
Sets the resolver used to resolve external entities.
voidsetErrorHandler(XMLErrorHandler errorHandler)
Allow an application to register an error event handler.
voidsetFeature(String featureId, boolean state)
Set the state of a feature.
voidsetLocale(Locale locale)
Set the locale to use for messages.
voidsetParameter(String name, Object value)
DOM Level 3 WD - Experimental. setParameter
voidsetProperty(String propertyId, Object value)
setProperty

Field Detail

CDATA

protected static final short CDATA

COMMENTS

protected static final short COMMENTS

DTD_VALIDATOR_FACTORY_PROPERTY

protected static final String DTD_VALIDATOR_FACTORY_PROPERTY

DTNORMALIZATION

protected static final short DTNORMALIZATION

DYNAMIC_VALIDATION

protected static final String DYNAMIC_VALIDATION

ENTITIES

protected static final short ENTITIES

ENTITY_MANAGER

protected static final String ENTITY_MANAGER
Property identifier: entity manager.

ENTITY_RESOLVER

protected static final String ENTITY_RESOLVER
Property identifier: entity resolver.

ERROR_HANDLER

protected static final String ERROR_HANDLER
Property identifier: error handler.

ERROR_REPORTER

protected static final String ERROR_REPORTER
Property identifier: error reporter.

fComponents

protected ArrayList fComponents
Components.

features

protected short features
Normalization features

fErrorHandlerWrapper

protected final DOMErrorHandlerWrapper fErrorHandlerWrapper

fErrorReporter

protected XMLErrorReporter fErrorReporter
Error reporter

fLocale

protected Locale fLocale
Locale.

fSymbolTable

protected SymbolTable fSymbolTable
Symbol table.

fValidationManager

protected ValidationManager fValidationManager

GRAMMAR_POOL

protected static final String GRAMMAR_POOL
Property id: Grammar pool

INFOSET_FALSE_PARAMS

protected static final short INFOSET_FALSE_PARAMS

INFOSET_MASK

protected static final short INFOSET_MASK

INFOSET_TRUE_PARAMS

protected static final short INFOSET_TRUE_PARAMS

JAXP_SCHEMA_LANGUAGE

protected static final String JAXP_SCHEMA_LANGUAGE
Property identifier: JAXP schema language / DOM schema-type.

JAXP_SCHEMA_SOURCE

protected static final String JAXP_SCHEMA_SOURCE
Property identifier: JAXP schema source/ DOM schema-location.

NAMESPACES

protected static final short NAMESPACES

NORMALIZE_DATA

protected static final String NORMALIZE_DATA

NSDECL

protected static final short NSDECL

PSVI

protected static final short PSVI

SCHEMA

protected static final String SCHEMA

SCHEMA_FULL_CHECKING

protected static final String SCHEMA_FULL_CHECKING

SEND_PSVI

protected static final String SEND_PSVI
sending psvi in the pipeline

SPLITCDATA

protected static final short SPLITCDATA

SYMBOL_TABLE

protected static final String SYMBOL_TABLE
Property identifier: symbol table.

VALIDATE

protected static final short VALIDATE

VALIDATION_MANAGER

protected static final String VALIDATION_MANAGER

WELLFORMED

protected static final short WELLFORMED

XERCES_NAMESPACES

protected static final String XERCES_NAMESPACES
Feature identifier: namespaces.

XERCES_VALIDATION

protected static final String XERCES_VALIDATION
Feature identifier: validation.

XML_STRING

protected static final String XML_STRING
Property identifier: xml string.

Constructor Detail

DOMConfigurationImpl

protected DOMConfigurationImpl()
Default Constructor.

DOMConfigurationImpl

protected DOMConfigurationImpl(SymbolTable symbolTable)
Constructs a parser configuration using the specified symbol table.

Parameters: symbolTable The symbol table to use.

DOMConfigurationImpl

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.

Method Detail

addComponent

protected void addComponent(XMLComponent component)

canSetParameter

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.

checkProperty

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: org.apache.xerces.xni.parser.XMLConfigurationException If the requested feature is not known or supported.

createValidationManager

protected ValidationManager createValidationManager()

getDocumentHandler

public XMLDocumentHandler getDocumentHandler()
Returns the registered document handler.

getDTDContentModelHandler

public XMLDTDContentModelHandler getDTDContentModelHandler()
Returns the registered DTD content model handler.

getDTDHandler

public XMLDTDHandler getDTDHandler()
Returns the registered DTD handler.

getEntityResolver

public XMLEntityResolver getEntityResolver()
Return the current entity resolver.

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

See Also: DOMConfigurationImpl

getErrorHandler

public XMLErrorHandler getErrorHandler()
Return the current error handler.

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

See Also: DOMConfigurationImpl

getLocale

public Locale getLocale()
Returns the locale.

getParameter

public Object getParameter(String name)
DOM Level 3 WD - Experimental. getParameter

getParameterNames

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.

parse

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: source 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.

reset

protected void reset()
reset all components before parsing

setDocumentHandler

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.

setDTDContentModelHandler

public void setDTDContentModelHandler(XMLDTDContentModelHandler handler)
Sets the DTD content model handler.

Parameters: handler The DTD content model handler.

setDTDHandler

public void setDTDHandler(XMLDTDHandler dtdHandler)
Sets the DTD handler.

Parameters: dtdHandler The DTD handler.

setEntityResolver

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.

setErrorHandler

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: java.lang.NullPointerException If the handler argument is null.

See Also: DOMConfigurationImpl

setFeature

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: org.apache.xerces.xni.parser.XMLConfigurationException If the requested feature is not known.

setLocale

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.

setParameter

public void setParameter(String name, Object value)
DOM Level 3 WD - Experimental. setParameter

setProperty

public void setProperty(String propertyId, Object value)
setProperty

Parameters: propertyId value

Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.