public class

XML11NonValidatingConfiguration

extends ParserConfigurationSettings
implements XML11Configurable XMLPullParserConfiguration
java.lang.Object
   ↳ org.apache.xerces.util.ParserConfigurationSettings
     ↳ org.apache.xerces.parsers.XML11NonValidatingConfiguration

Class Overview

This class is the non vlaidating parser configuration used to parse XML 1.0 and XML 1.1 documents. Xerces parser that uses this configuration is not conformant non-validating XML processor, since conformant non-validating processor is required to process "all the declarations they read in the internal DTD subset ... must use the information in those declarations to normalize attribute values, include the replacement text of internal entities, and supply default attribute values".

Summary

Constants
String CONTINUE_AFTER_FATAL_ERROR Feature identifier: continue after fatal error.
String DATATYPE_VALIDATOR_FACTORY Property identifier: datatype validator factory.
String DOCUMENT_SCANNER Property identifier document scanner:
String DTD_SCANNER Property identifier: DTD scanner.
String DTD_VALIDATOR Property identifier: DTD validator.
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 EXTERNAL_GENERAL_ENTITIES Feature identifier: external general entities.
String EXTERNAL_PARAMETER_ENTITIES Feature identifier: external parameter entities.
String NAMESPACES Feature identifier: namespaces.
String NAMESPACE_BINDER Property identifier: namespace binder.
boolean PRINT_EXCEPTION_STACK_TRACE Set to true and recompile to print exception stack trace.
String SYMBOL_TABLE Property identifier: symbol table.
String VALIDATION Feature identifier: validation.
String VALIDATION_MANAGER
String XML11_DATATYPE_VALIDATOR_FACTORY
String XMLGRAMMAR_POOL Property identifier: grammar pool.
String XML_STRING Property identifier: xml string.
[Expand]
Inherited Constants
From class org.apache.xerces.util.ParserConfigurationSettings
Fields
protected ArrayList fCommonComponents Common components: XMLEntityManager, XMLErrorReporter
protected ArrayList fComponents XML 1.0 Components.
protected boolean fConfigUpdated fConfigUpdated is set to true if there has been any change to the configuration settings, i.e a feature or a property was changed.
protected XMLDTDScanner fCurrentDTDScanner Current DTD scanner.
protected DTDDVFactory fCurrentDVFactory Current Datatype validator factory.
protected XMLDocumentScanner fCurrentScanner Current scanner
protected XMLDTDContentModelHandler fDTDContentModelHandler The DTD content model handler.
protected XMLDTDHandler fDTDHandler The DTD handler.
protected XMLDTDScanner fDTDScanner The XML 1.0 DTD scanner.
protected DTDDVFactory fDatatypeValidatorFactory The XML 1.0 Datatype validator factory.
protected XMLDocumentHandler fDocumentHandler The document handler.
protected XMLEntityManager fEntityManager Entity manager.
protected XMLErrorReporter fErrorReporter Error reporter.
protected XMLGrammarPool fGrammarPool Grammar pool.
protected XMLInputSource fInputSource
protected XMLDocumentSource fLastComponent Last component in the document pipeline
protected Locale fLocale
protected XMLLocator fLocator
protected XMLNSDocumentScannerImpl fNamespaceScanner The XML 1.0 Document scanner that does namespace binding.
protected XMLDocumentScannerImpl fNonNSScanner The XML 1.0 Non-namespace implementation of scanner
protected boolean fParseInProgress True if a parse is in progress.
protected SymbolTable fSymbolTable
protected ValidationManager fValidationManager
protected XMLVersionDetector fVersionDetector
protected ArrayList fXML11Components XML 1.1.
protected XML11DTDScannerImpl fXML11DTDScanner The XML 1.1 DTD scanner.
protected DTDDVFactory fXML11DatatypeFactory The XML 1.1 datatype factory.
protected XML11DocumentScannerImpl fXML11DocScanner The XML 1.1 document scanner that does not do namespace binding.
protected XML11NSDocumentScannerImpl fXML11NSDocScanner The XML 1.1 document scanner that does namespace binding.
[Expand]
Inherited Fields
From class org.apache.xerces.util.ParserConfigurationSettings
Public Constructors
XML11NonValidatingConfiguration()
Default constructor.
XML11NonValidatingConfiguration(SymbolTable symbolTable)
Constructs a parser configuration using the specified symbol table.
XML11NonValidatingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool)
Constructs a parser configuration using the specified symbol table and grammar pool.
XML11NonValidatingConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings)
Constructs a parser configuration using the specified symbol table, grammar pool, and parent settings.
Public Methods
void cleanup()
If the application decides to terminate parsing before the xml document is fully parsed, the application should call this method to free any resource allocated during parsing.
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.
boolean parse(boolean complete)
Parses the document in a pull parsing fashion.
void parse(XMLInputSource source)
Parses the specified input source.
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 setInputSource(XMLInputSource inputSource)
Sets the input source for the document to parse.
void setLocale(Locale locale)
Set the locale to use for messages.
void setProperty(String propertyId, Object value)
setProperty
Protected Methods
void addCommonComponent(XMLComponent component)
Adds common component to the parser configuration.
void addComponent(XMLComponent component)
Adds a component to the parser configuration.
void addRecognizedParamsAndSetDefaults(XMLComponent component)
Adds all of the component's recognized features and properties to the list of default recognized features and properties, and sets default values on the configuration for features and properties which were previously absent from the configuration.
void addXML11Component(XMLComponent component)
Adds an XML 1.1 component to the parser configuration.
void checkFeature(String featureId)
Check a feature.
void checkProperty(String propertyId)
Check a property.
void configurePipeline()
Configures the pipeline.
void configureXML11Pipeline()
Configures the XML 1.1 pipeline.
void reset()
reset all XML 1.0 components before parsing and namespace context
void resetCommon()
reset all common components before parsing
void resetXML11()
reset all components before parsing and namespace context
[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.apache.xerces.xni.parser.XMLPullParserConfiguration

Constants

protected static final String CONTINUE_AFTER_FATAL_ERROR

Feature identifier: continue after fatal error.

Constant Value: "http://apache.org/xml/features/continue-after-fatal-error"

protected static final String DATATYPE_VALIDATOR_FACTORY

Property identifier: datatype validator factory.

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

protected static final String DOCUMENT_SCANNER

Property identifier document scanner:

Constant Value: "http://apache.org/xml/properties/internal/document-scanner"

protected static final String DTD_SCANNER

Property identifier: DTD scanner.

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

protected static final String DTD_VALIDATOR

Property identifier: DTD validator.

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

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 EXTERNAL_GENERAL_ENTITIES

Feature identifier: external general entities.

Constant Value: "http://xml.org/sax/features/external-general-entities"

protected static final String EXTERNAL_PARAMETER_ENTITIES

Feature identifier: external parameter entities.

Constant Value: "http://xml.org/sax/features/external-parameter-entities"

protected static final String NAMESPACES

Feature identifier: namespaces.

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

protected static final String NAMESPACE_BINDER

Property identifier: namespace binder.

Constant Value: "http://apache.org/xml/properties/internal/namespace-binder"

protected static final boolean PRINT_EXCEPTION_STACK_TRACE

Set to true and recompile to print exception stack trace.

Constant Value: false

protected static final String SYMBOL_TABLE

Property identifier: symbol table.

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

protected static final String VALIDATION

Feature identifier: validation.

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

protected static final String VALIDATION_MANAGER

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

protected static final String XML11_DATATYPE_VALIDATOR_FACTORY

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

protected static final String XMLGRAMMAR_POOL

Property identifier: grammar pool.

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

protected static final String XML_STRING

Property identifier: xml string.

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

Fields

protected ArrayList fCommonComponents

Common components: XMLEntityManager, XMLErrorReporter

protected ArrayList fComponents

XML 1.0 Components.

protected boolean fConfigUpdated

fConfigUpdated is set to true if there has been any change to the configuration settings, i.e a feature or a property was changed.

protected XMLDTDScanner fCurrentDTDScanner

Current DTD scanner.

protected DTDDVFactory fCurrentDVFactory

Current Datatype validator factory.

protected XMLDocumentScanner fCurrentScanner

Current scanner

protected XMLDTDContentModelHandler fDTDContentModelHandler

The DTD content model handler.

protected XMLDTDHandler fDTDHandler

The DTD handler.

protected XMLDTDScanner fDTDScanner

The XML 1.0 DTD scanner.

protected DTDDVFactory fDatatypeValidatorFactory

The XML 1.0 Datatype validator factory.

protected XMLDocumentHandler fDocumentHandler

The document handler.

protected XMLEntityManager fEntityManager

Entity manager.

protected XMLErrorReporter fErrorReporter

Error reporter.

protected XMLGrammarPool fGrammarPool

Grammar pool.

protected XMLInputSource fInputSource

protected XMLDocumentSource fLastComponent

Last component in the document pipeline

protected Locale fLocale

protected XMLLocator fLocator

protected XMLNSDocumentScannerImpl fNamespaceScanner

The XML 1.0 Document scanner that does namespace binding.

protected XMLDocumentScannerImpl fNonNSScanner

The XML 1.0 Non-namespace implementation of scanner

protected boolean fParseInProgress

True if a parse is in progress. This state is needed because some features/properties cannot be set while parsing (e.g. namespaces).

protected SymbolTable fSymbolTable

protected ValidationManager fValidationManager

protected XMLVersionDetector fVersionDetector

protected ArrayList fXML11Components

XML 1.1. Components.

protected XML11DTDScannerImpl fXML11DTDScanner

The XML 1.1 DTD scanner.

protected DTDDVFactory fXML11DatatypeFactory

The XML 1.1 datatype factory.

protected XML11DocumentScannerImpl fXML11DocScanner

The XML 1.1 document scanner that does not do namespace binding.

protected XML11NSDocumentScannerImpl fXML11NSDocScanner

The XML 1.1 document scanner that does namespace binding.

Public Constructors

public XML11NonValidatingConfiguration ()

Default constructor.

public XML11NonValidatingConfiguration (SymbolTable symbolTable)

Constructs a parser configuration using the specified symbol table.

Parameters
symbolTable The symbol table to use.

public XML11NonValidatingConfiguration (SymbolTable symbolTable, XMLGrammarPool grammarPool)

Constructs a parser configuration using the specified symbol table and grammar pool.

REVISIT: Grammar pool will be updated when the new validation engine is implemented.

Parameters
symbolTable The symbol table to use.
grammarPool The grammar pool to use.

public XML11NonValidatingConfiguration (SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings)

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

REVISIT: Grammar pool will be updated when the new validation engine is implemented.

Parameters
symbolTable The symbol table to use.
grammarPool The grammar pool to use.
parentSettings The parent settings.

Public Methods

public void cleanup ()

If the application decides to terminate parsing before the xml document is fully parsed, the application should call this method to free any resource allocated during parsing. For example, close all opened streams.

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 boolean parse (boolean complete)

Parses the document in a pull parsing fashion.

Parameters
complete True if the pull parser should parse the remaining document completely.
Returns
  • True if there is more document to parse.

public void parse (XMLInputSource source)

Parses the specified input source.

Parameters
source The input source.
Throws
XNIException Throws exception on XNI error.
IOException Throws exception on i/o error.

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 setInputSource (XMLInputSource inputSource)

Sets the input source for the document to parse.

Parameters
inputSource The document's input source.
Throws
XMLConfigurationException Thrown if there is a configuration error when initializing the parser.
IOException Thrown on I/O error.
See Also

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 setProperty (String propertyId, Object value)

setProperty

Protected Methods

protected void addCommonComponent (XMLComponent component)

Adds common component to the parser configuration. This method will also add all of the component's recognized features and properties to the list of default recognized features and properties.

Parameters
component The component to add.

protected void addComponent (XMLComponent component)

Adds a component to the parser configuration. This method will also add all of the component's recognized features and properties to the list of default recognized features and properties.

Parameters
component The component to add.

protected void addRecognizedParamsAndSetDefaults (XMLComponent component)

Adds all of the component's recognized features and properties to the list of default recognized features and properties, and sets default values on the configuration for features and properties which were previously absent from the configuration.

Parameters
component The component whose recognized features and properties will be added to the configuration

protected void addXML11Component (XMLComponent component)

Adds an XML 1.1 component to the parser configuration. This method will also add all of the component's recognized features and properties to the list of default recognized features and properties.

Parameters
component The component to add.

protected void checkFeature (String featureId)

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

Parameters
featureId The unique identifier (URI) of the feature.
Throws
XMLConfigurationException Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

protected void checkProperty (String propertyId)

Check a property. If the property is know 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 Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

protected void configurePipeline ()

Configures the pipeline.

protected void configureXML11Pipeline ()

Configures the XML 1.1 pipeline. Note: this method also resets the new XML11 components.

protected void reset ()

reset all XML 1.0 components before parsing and namespace context

Throws
XNIException

protected void resetCommon ()

reset all common components before parsing

Throws
XNIException

protected void resetXML11 ()

reset all components before parsing and namespace context

Throws
XNIException