FileDocCategorySizeDatePackage
SchemaValidatorConfiguration.javaAPI DocApache Xerces 3.0.16269Fri Sep 14 20:33:52 BST 2007org.apache.xerces.jaxp

SchemaValidatorConfiguration

public final class SchemaValidatorConfiguration extends Object implements org.apache.xerces.xni.parser.XMLComponentManager

Parser configuration for Xerces' XMLSchemaValidator.

version
$Id: SchemaValidatorConfiguration.java 447237 2006-09-18 05:03:10Z mrglavas $

Fields Summary
private static final String
SCHEMA_VALIDATION
Feature identifier: schema validation.
private static final String
VALIDATION
Feature identifier: validation.
private static final String
USE_GRAMMAR_POOL_ONLY
Feature identifier: use grammar pool only.
private static final String
PARSER_SETTINGS
Feature identifier: parser settings.
private static final String
ERROR_REPORTER
Property identifier: error reporter.
private static final String
VALIDATION_MANAGER
Property identifier: validation manager.
private static final String
XMLGRAMMAR_POOL
Property identifier: grammar pool.
private final org.apache.xerces.xni.parser.XMLComponentManager
fParentComponentManager
Parent component manager.
private final org.apache.xerces.xni.grammars.XMLGrammarPool
fGrammarPool
The Schema's grammar pool.
private final boolean
fUseGrammarPoolOnly
Tracks whether the validator should use components from the grammar pool to the exclusion of all others.
private final org.apache.xerces.impl.validation.ValidationManager
fValidationManager
Validation manager.
Constructors Summary
public SchemaValidatorConfiguration(org.apache.xerces.xni.parser.XMLComponentManager parentManager, org.apache.xerces.jaxp.validation.XSGrammarPoolContainer grammarContainer, org.apache.xerces.impl.validation.ValidationManager validationManager)

    
       
                
        fParentComponentManager = parentManager;
        fGrammarPool = grammarContainer.getGrammarPool();
        fUseGrammarPoolOnly = grammarContainer.isFullyComposed();
        fValidationManager = validationManager;
        // add schema message formatter to error reporter
        try {
            XMLErrorReporter errorReporter = (XMLErrorReporter) fParentComponentManager.getProperty(ERROR_REPORTER);
            if (errorReporter != null) {
                errorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
            }
        }
        // Ignore exception.
        catch (XMLConfigurationException exc) {}
    
Methods Summary
public booleangetFeature(java.lang.String featureId)
Returns the state of a feature.

param
featureId The feature identifier.
return
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.

        if (PARSER_SETTINGS.equals(featureId)) {
            return fParentComponentManager.getFeature(featureId);
        }
        else if (VALIDATION.equals(featureId) || SCHEMA_VALIDATION.equals(featureId)) {
            return true;
        }
        else if (USE_GRAMMAR_POOL_ONLY.equals(featureId)) {
            return fUseGrammarPoolOnly;
        }
        return fParentComponentManager.getFeature(featureId);
    
public java.lang.ObjectgetProperty(java.lang.String propertyId)
Returns the value of a property.

param
propertyId The property identifier.
return
the value of the property
throws
XMLConfigurationException Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

        if (XMLGRAMMAR_POOL.equals(propertyId)) {
            return fGrammarPool;
        }
        else if (VALIDATION_MANAGER.equals(propertyId)) {
            return fValidationManager;
        }
        return fParentComponentManager.getProperty(propertyId);