public class

SchemaParsingConfig

extends BasicParserConfiguration
implements XMLPullParserConfiguration
java.lang.Object
   ↳ org.apache.xerces.util.ParserConfigurationSettings
     ↳ org.apache.xerces.parsers.BasicParserConfiguration
       ↳ org.apache.xerces.impl.xs.opti.SchemaParsingConfig

Summary

Constants
String ALLOW_JAVA_ENCODINGS Feature identifier: allow Java encodings.
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 ERROR_REPORTER Property identifier: error reporter.
String GENERATE_SYNTHETIC_ANNOTATIONS Feature identifier: generate synthetic annotations.
String LOAD_EXTERNAL_DTD Feature identifier: load external DTD.
String NAMESPACE_BINDER Property identifier: namespace binder.
String NORMALIZE_DATA Feature identifier: expose schema normalized value
String NOTIFY_BUILTIN_REFS Feature identifier: notify built-in refereces.
String NOTIFY_CHAR_REFS Feature identifier: notify character refereces.
String SCHEMA_ELEMENT_DEFAULT Feature identifier: send element default value via characters()
String SCHEMA_VALIDATOR Property identifier: XML Schema validator.
String VALIDATION_MANAGER
String WARN_ON_DUPLICATE_ATTDEF Feature identifier: warn on duplicate attribute definition.
String WARN_ON_UNDECLARED_ELEMDEF Feature identifier: warn on undeclared element definition.
String XML11_DATATYPE_VALIDATOR_FACTORY
String XMLGRAMMAR_POOL Property identifier: grammar pool.
[Expand]
Inherited Constants
From class org.apache.xerces.parsers.BasicParserConfiguration
From class org.apache.xerces.util.ParserConfigurationSettings
Fields
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 final XMLDTDScannerImpl fDTDScanner The XML 1.0 DTD scanner.
protected final DTDDVFactory fDatatypeValidatorFactory The XML 1.0 Datatype validator factory.
protected final XMLEntityManager fEntityManager Entity manager.
protected final XMLErrorReporter fErrorReporter Error reporter.
protected XMLGrammarPool fGrammarPool Grammar pool.
protected XMLInputSource fInputSource Input Source
protected XMLLocator fLocator Locator
protected final XMLNSDocumentScannerImpl fNamespaceScanner The XML 1.0 Document scanner.
protected boolean fParseInProgress True if a parse is in progress.
protected SchemaDOMParser fSchemaDOMParser
protected final ValidationManager fValidationManager
protected final XMLVersionDetector fVersionDetector XML version detector.
protected XML11DTDScannerImpl fXML11DTDScanner The XML 1.1 DTD scanner.
protected DTDDVFactory fXML11DatatypeFactory The XML 1.1 Datatype validator factory.
protected XML11NSDocumentScannerImpl fXML11NSDocScanner The XML 1.1 Document scanner.
[Expand]
Inherited Fields
From class org.apache.xerces.parsers.BasicParserConfiguration
From class org.apache.xerces.util.ParserConfigurationSettings
Public Constructors
SchemaParsingConfig()
Default constructor.
SchemaParsingConfig(SymbolTable symbolTable)
Constructs a parser configuration using the specified symbol table.
SchemaParsingConfig(SymbolTable symbolTable, XMLGrammarPool grammarPool)
Constructs a parser configuration using the specified symbol table and grammar pool.
SchemaParsingConfig(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.
Document getDocument()
Returns the Document object.
boolean getFeature(String featureId)
Returns the state of a feature.
boolean parse(boolean complete)
Parses the document in a pull parsing fashion.
void parse(XMLInputSource source)
Parses the specified input source.
void reset()
Reset all components before parsing.
void resetNodePool()
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 checkFeature(String featureId)
Check a feature.
void checkProperty(String propertyId)
Check a property.
void configurePipeline()
Configures the XML 1.0 pipeline.
void configureXML11Pipeline()
Configures the XML 1.1 pipeline.
final void resetXML10()
Reset all XML 1.0 components before parsing
final void resetXML11()
Reset all XML 1.1 components before parsing
[Expand]
Inherited Methods
From class org.apache.xerces.parsers.BasicParserConfiguration
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 ALLOW_JAVA_ENCODINGS

Feature identifier: allow Java encodings.

Constant Value: "http://apache.org/xml/features/allow-java-encodings"

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 ERROR_REPORTER

Property identifier: error reporter.

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

protected static final String GENERATE_SYNTHETIC_ANNOTATIONS

Feature identifier: generate synthetic annotations.

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

protected static final String LOAD_EXTERNAL_DTD

Feature identifier: load external DTD.

Constant Value: "http://apache.org/xml/features/nonvalidating/load-external-dtd"

protected static final String NAMESPACE_BINDER

Property identifier: namespace binder.

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

protected static final String NORMALIZE_DATA

Feature identifier: expose schema normalized value

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

protected static final String NOTIFY_BUILTIN_REFS

Feature identifier: notify built-in refereces.

Constant Value: "http://apache.org/xml/features/scanner/notify-builtin-refs"

protected static final String NOTIFY_CHAR_REFS

Feature identifier: notify character refereces.

Constant Value: "http://apache.org/xml/features/scanner/notify-char-refs"

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_VALIDATOR

Property identifier: XML Schema validator.

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

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 String WARN_ON_UNDECLARED_ELEMDEF

Feature identifier: warn on undeclared element definition.

Constant Value: "http://apache.org/xml/features/validation/warn-on-undeclared-elemdef"

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"

Fields

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 final XMLDTDScannerImpl fDTDScanner

The XML 1.0 DTD scanner.

protected final DTDDVFactory fDatatypeValidatorFactory

The XML 1.0 Datatype validator factory.

protected final XMLEntityManager fEntityManager

Entity manager.

protected final XMLErrorReporter fErrorReporter

Error reporter.

protected XMLGrammarPool fGrammarPool

Grammar pool.

protected XMLInputSource fInputSource

Input Source

protected XMLLocator fLocator

Locator

protected final XMLNSDocumentScannerImpl fNamespaceScanner

The XML 1.0 Document 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. validation and namespaces).

protected SchemaDOMParser fSchemaDOMParser

protected final ValidationManager fValidationManager

protected final XMLVersionDetector fVersionDetector

XML version detector.

protected XML11DTDScannerImpl fXML11DTDScanner

The XML 1.1 DTD scanner.

protected DTDDVFactory fXML11DatatypeFactory

The XML 1.1 Datatype validator factory.

protected XML11NSDocumentScannerImpl fXML11NSDocScanner

The XML 1.1 Document scanner.

Public Constructors

public SchemaParsingConfig ()

Default constructor.

public SchemaParsingConfig (SymbolTable symbolTable)

Constructs a parser configuration using the specified symbol table.

Parameters
symbolTable The symbol table to use.

public SchemaParsingConfig (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 SchemaParsingConfig (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 Document getDocument ()

Returns the Document object.

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 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.
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 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 reset ()

Reset all components before parsing.

Throws
XNIException Thrown if an error occurs during initialization.

public void resetNodePool ()

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 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 XML 1.0 pipeline.

protected void configureXML11Pipeline ()

Configures the XML 1.1 pipeline.

protected final void resetXML10 ()

Reset all XML 1.0 components before parsing

Throws
XNIException

protected final void resetXML11 ()

Reset all XML 1.1 components before parsing

Throws
XNIException