FileDocCategorySizeDatePackage
SchemaValidatorConfiguration.javaAPI DocJava SE 6 API6094Tue Jun 10 00:22:48 BST 2008com.sun.org.apache.xerces.internal.jaxp

SchemaValidatorConfiguration

public final class SchemaValidatorConfiguration extends Object implements XMLComponentManager

Parser configuration for Xerces' XMLSchemaValidator.

version
$Id: SchemaValidatorConfiguration.java,v 1.1.4.1 2005/09/08 05:48:45 sunithareddy Exp $

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 XMLComponentManager
fParentComponentManager
Parent component manager.
private final 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 ValidationManager
fValidationManager
Validation manager.
Constructors Summary
public SchemaValidatorConfiguration(XMLComponentManager parentManager, XSGrammarPoolContainer grammarContainer, 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);