Top Description Fields Constructors Methods
org.apache.xerces.jaxp.validation

pack-priv final Class XMLSchemaValidatorComponentManager

extends ParserConfigurationSettings
implements XMLComponentManager
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xni.parser.XMLComponentManager
Imports
java.util.HashMap, .Iterator, .Locale, .Map, javax.xml.XMLConstants, org.apache.xerces.impl.Constants, .XMLEntityManager, .XMLErrorReporter, org.apache.xerces.impl.validation.ValidationManager, org.apache.xerces.impl.xs.XMLSchemaValidator, .XSMessageFormatter, org.apache.xerces.util.DOMEntityResolverWrapper, .ErrorHandlerWrapper, .NamespaceSupport, .ParserConfigurationSettings, .SecurityManager, .SymbolTable, org.apache.xerces.xni.NamespaceContext, .XNIException, org.apache.xerces.xni.parser.XMLComponent, .XMLComponentManager, .XMLConfigurationException, org.w3c.dom.ls.LSResourceResolver, org.xml.sax.ErrorHandler

An implementation of XMLComponentManager for a schema validator.

Author
Michael Glavassevich, IBM
Version
$Id: XMLSchemaValidatorComponentManager.java 948952 2010-05-27 19:06:12Z mrglavas $

Field Summary

Modifier and TypeField and Description
private static final String
DISALLOW_DOCTYPE_DECL_FEATURE

Feature identifier: disallow DOCTYPE declaration

private static final String
ENTITY_MANAGER

Property identifier: entity manager.

private static final String
ENTITY_RESOLVER

Property identifier: entity resolver.

private static final String
ERROR_HANDLER

Property identifier: error handler.

private static final String
ERROR_REPORTER

Property identifier: error reporter.

private final HashMap<K, V>
fComponents

Lookup map for components required for validation.

private 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.

private final XMLEntityManager
fEntityManager

Entity manager.

private ErrorHandler
fErrorHandler

Application's ErrorHandler.

private final XMLErrorReporter
fErrorReporter

Error reporter.

private final HashMap<K, V>
fInitFeatures

Stores initial feature values for validator reset.

private final HashMap<K, V>
fInitProperties

Stores initial property values for validator reset.

private final SecurityManager
fInitSecurityManager

Stores the initial security manager.

private Locale
fLocale

Locale chosen by the application.

private final NamespaceContext
fNamespaceContext

Namespace context.

private LSResourceResolver
fResourceResolver

Application's LSResourceResolver.

private final XMLSchemaValidator
fSchemaValidator

XML Schema validator.

private boolean
fUseGrammarPoolOnly

Tracks whether the validator should use components from the grammar pool to the exclusion of all others.

private final ValidationManager
fValidationManager

Validation manager.

private static final String
ID_IDREF_CHECKING

Feature identifier: whether to ignore ID/IDREF errors

private static final String
IDENTITY_CONSTRAINT_CHECKING

Feature identifier: whether to ignore identity constraint errors

private static final String
IGNORE_XSI_TYPE

Feature identifier: whether to ignore xsi:type attributes until a global element declaration is encountered

private static final String
LOCALE

Property identifier: locale.

private static final String
NAMESPACE_CONTEXT

Property identifier: namespace context.

private static final String
NORMALIZE_DATA

Feature identifier: expose schema normalized value

private static final String
SCHEMA_AUGMENT_PSVI

Feature identifier: augment PSVI

private static final String
SCHEMA_ELEMENT_DEFAULT

Feature identifier: send element default value via characters()

private static final String
SCHEMA_VALIDATION

Feature identifier: schema validation.

private static final String
SCHEMA_VALIDATOR

Property identifier: XML Schema validator.

private static final String
SECURITY_MANAGER

Property identifier: security manager.

private static final String
SYMBOL_TABLE

Property identifier: symbol table.

private static final String
UNPARSED_ENTITY_CHECKING

Feature identifier: whether to ignore unparsed entity errors

private static final String
USE_GRAMMAR_POOL_ONLY

Feature identifier: use grammar pool only.

private static final String
VALIDATION

Feature identifier: validation.

private static final String
VALIDATION_MANAGER

Property identifier: validation manager.

private static final String
XMLGRAMMAR_POOL

Property identifier: grammar pool.

Inherited from org.apache.xerces.util.ParserConfigurationSettings:
fFeaturesfParentSettingsfPropertiesfRecognizedFeaturesfRecognizedPropertiesPARSER_SETTINGS

Constructor Summary

AccessConstructor and Description
public
XMLSchemaValidatorComponentManager(XSGrammarPoolContainer grammarContainer)

Constructs a component manager suitable for Xerces' schema validator.

Method Summary

Modifier and TypeMethod and Description
public void
addRecognizedParamsAndSetDefaults(XMLComponent
The component whose recognized features and properties will be added to the configuration
component
,
XSGrammarPoolContainer grammarContainer)

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.

pack-priv ErrorHandler
public boolean

Returns:

true if the feature is supported
getFeature
(String
The feature identifier.
featureId
)

Overrides org.apache.xerces.util.ParserConfigurationSettings.getFeature.

Implements org.apache.xerces.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature.
pack-priv Locale
public Object

Returns:

the value of the property
getProperty
(String
The property identifier.
propertyId
)

Overrides org.apache.xerces.util.ParserConfigurationSettings.getProperty.

Implements org.apache.xerces.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property.
pack-priv LSResourceResolver
public void
reset()

Calls reset on each of the components owned by this component manager.

pack-priv void
restoreInitialState()

Cleans out configuration, restoring it to its initial state.

pack-priv void
public void
setFeature(String
The unique identifier (URI) of the feature.
featureId
,
boolean
The requested state of the feature (true or false).
value
)

Overrides org.apache.xerces.util.ParserConfigurationSettings.setFeature.

Set the state of a feature.
private void
setFeatureDefaults(final XMLComponent component, final String[] recognizedFeatures, XSGrammarPoolContainer grammarContainer)

Sets feature defaults for the given component on this configuration.

pack-priv void
setLocale(Locale locale)

public void
setProperty(String
The unique identifier (URI) of the property.
propertyId
,
Object
The requested state of the property.
value
)

Overrides org.apache.xerces.util.ParserConfigurationSettings.setProperty.

Sets the state of a property.
private void
setPropertyDefaults(final XMLComponent component, final String[] recognizedProperties)

Sets property defaults for the given component on this configuration.

pack-priv void
Inherited from org.apache.xerces.util.ParserConfigurationSettings:
addRecognizedFeaturesaddRecognizedPropertiescheckFeaturecheckProperty

Field Detail

DISALLOW_DOCTYPE_DECL_FEATUREback to summary
private static final String DISALLOW_DOCTYPE_DECL_FEATURE

Feature identifier: disallow DOCTYPE declaration

ENTITY_MANAGERback to summary
private static final String ENTITY_MANAGER

Property identifier: entity manager.

ENTITY_RESOLVERback to summary
private static final String ENTITY_RESOLVER

Property identifier: entity resolver.

ERROR_HANDLERback to summary
private static final String ERROR_HANDLER

Property identifier: error handler.

ERROR_REPORTERback to summary
private static final String ERROR_REPORTER

Property identifier: error reporter.

fComponentsback to summary
private final HashMap<K, V> fComponents

Lookup map for components required for validation.

fConfigUpdatedback to summary
private 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.

fEntityManagerback to summary
private final XMLEntityManager fEntityManager

Entity manager.

fErrorHandlerback to summary
private ErrorHandler fErrorHandler

Application's ErrorHandler.

fErrorReporterback to summary
private final XMLErrorReporter fErrorReporter

Error reporter.

fInitFeaturesback to summary
private final HashMap<K, V> fInitFeatures

Stores initial feature values for validator reset.

fInitPropertiesback to summary
private final HashMap<K, V> fInitProperties

Stores initial property values for validator reset.

fInitSecurityManagerback to summary
private final SecurityManager fInitSecurityManager

Stores the initial security manager.

fLocaleback to summary
private Locale fLocale

Locale chosen by the application.

fNamespaceContextback to summary
private final NamespaceContext fNamespaceContext

Namespace context.

fResourceResolverback to summary
private LSResourceResolver fResourceResolver

Application's LSResourceResolver.

fSchemaValidatorback to summary
private final XMLSchemaValidator fSchemaValidator

XML Schema validator.

fUseGrammarPoolOnlyback to summary
private boolean fUseGrammarPoolOnly

Tracks whether the validator should use components from the grammar pool to the exclusion of all others.

fValidationManagerback to summary
private final ValidationManager fValidationManager

Validation manager.

ID_IDREF_CHECKINGback to summary
private static final String ID_IDREF_CHECKING

Feature identifier: whether to ignore ID/IDREF errors

IDENTITY_CONSTRAINT_CHECKINGback to summary
private static final String IDENTITY_CONSTRAINT_CHECKING

Feature identifier: whether to ignore identity constraint errors

IGNORE_XSI_TYPEback to summary
private static final String IGNORE_XSI_TYPE

Feature identifier: whether to ignore xsi:type attributes until a global element declaration is encountered

LOCALEback to summary
private static final String LOCALE

Property identifier: locale.

NAMESPACE_CONTEXTback to summary
private static final String NAMESPACE_CONTEXT

Property identifier: namespace context.

NORMALIZE_DATAback to summary
private static final String NORMALIZE_DATA

Feature identifier: expose schema normalized value

SCHEMA_AUGMENT_PSVIback to summary
private static final String SCHEMA_AUGMENT_PSVI

Feature identifier: augment PSVI

SCHEMA_ELEMENT_DEFAULTback to summary
private static final String SCHEMA_ELEMENT_DEFAULT

Feature identifier: send element default value via characters()

SCHEMA_VALIDATIONback to summary
private static final String SCHEMA_VALIDATION

Feature identifier: schema validation.

SCHEMA_VALIDATORback to summary
private static final String SCHEMA_VALIDATOR

Property identifier: XML Schema validator.

SECURITY_MANAGERback to summary
private static final String SECURITY_MANAGER

Property identifier: security manager.

SYMBOL_TABLEback to summary
private static final String SYMBOL_TABLE

Property identifier: symbol table.

UNPARSED_ENTITY_CHECKINGback to summary
private static final String UNPARSED_ENTITY_CHECKING

Feature identifier: whether to ignore unparsed entity errors

USE_GRAMMAR_POOL_ONLYback to summary
private static final String USE_GRAMMAR_POOL_ONLY

Feature identifier: use grammar pool only.

VALIDATIONback to summary
private static final String VALIDATION

Feature identifier: validation.

VALIDATION_MANAGERback to summary
private static final String VALIDATION_MANAGER

Property identifier: validation manager.

XMLGRAMMAR_POOLback to summary
private static final String XMLGRAMMAR_POOL

Property identifier: grammar pool.

Constructor Detail

XMLSchemaValidatorComponentManagerback to summary
public XMLSchemaValidatorComponentManager(XSGrammarPoolContainer grammarContainer)

Constructs a component manager suitable for Xerces' schema validator.

Method Detail

addRecognizedParamsAndSetDefaultsback to summary
public void addRecognizedParamsAndSetDefaults(XMLComponent component, XSGrammarPoolContainer grammarContainer)

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:XMLComponent

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

getErrorHandlerback to summary
pack-priv ErrorHandler getErrorHandler()
getFeatureback to summary
public boolean getFeature(String featureId) throws XMLConfigurationException

Overrides org.apache.xerces.util.ParserConfigurationSettings.getFeature.

Implements org.apache.xerces.xni.parser.XMLComponentManager.getFeature.

Returns the state of a feature.

Parameters
featureId:String

The feature identifier.

Returns:boolean

true if the feature is supported

Exceptions
XMLConfigurationException:
Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
getLocaleback to summary
pack-priv Locale getLocale()
getPropertyback to summary
public Object getProperty(String propertyId) throws XMLConfigurationException

Overrides org.apache.xerces.util.ParserConfigurationSettings.getProperty.

Implements org.apache.xerces.xni.parser.XMLComponentManager.getProperty.

Returns the value of a property.

Parameters
propertyId:String

The property identifier.

Returns:Object

the value of the property

Exceptions
XMLConfigurationException:
Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
getResourceResolverback to summary
pack-priv LSResourceResolver getResourceResolver()
resetback to summary
public void reset() throws XNIException

Calls reset on each of the components owned by this component manager.

restoreInitialStateback to summary
pack-priv void restoreInitialState()

Cleans out configuration, restoring it to its initial state.

setErrorHandlerback to summary
pack-priv void setErrorHandler(ErrorHandler errorHandler)
setFeatureback to summary
public void setFeature(String featureId, boolean value) throws XMLConfigurationException

Overrides org.apache.xerces.util.ParserConfigurationSettings.setFeature.

Set the state of a feature.

Parameters
featureId:String

The unique identifier (URI) of the feature.

value:boolean

The requested state of the feature (true or false).

Exceptions
XMLConfigurationException:
If the requested feature is not known.
setFeatureDefaultsback to summary
private void setFeatureDefaults(final XMLComponent component, final String[] recognizedFeatures, XSGrammarPoolContainer grammarContainer)

Sets feature defaults for the given component on this configuration.

setLocaleback to summary
pack-priv void setLocale(Locale locale)
setPropertyback to summary
public void setProperty(String propertyId, Object value) throws XMLConfigurationException

Overrides org.apache.xerces.util.ParserConfigurationSettings.setProperty.

Sets the state of a property.

Parameters
propertyId:String

The unique identifier (URI) of the property.

value:Object

The requested state of the property.

Exceptions
XMLConfigurationException:
If the requested property is not known.
setPropertyDefaultsback to summary
private void setPropertyDefaults(final XMLComponent component, final String[] recognizedProperties)

Sets property defaults for the given component on this configuration.

setResourceResolverback to summary
pack-priv void setResourceResolver(LSResourceResolver resourceResolver)