Home » Xerces-J-src.2.9.1 » org.apache.xerces » impl » xs » [javadoc | source]
org.apache.xerces.impl.xs
public class: XMLSchemaValidator [javadoc | source]
java.lang.Object
   org.apache.xerces.impl.xs.XMLSchemaValidator

All Implemented Interfaces:
    XMLComponent, XMLDocumentFilter, RevalidationHandler, FieldActivator

The XML Schema validator. The validator implements a document filter: receiving document events from the scanner; validating the content and structure; augmenting the InfoSet, if applicable; and notifying the parser of the information resulting from the validation process.

This component requires the following features and properties from the component manager that uses it:

Nested Class Summary:
protected final class  XMLSchemaValidator.XSIErrorReporter  A wrapper of the standard error reporter. We'll store all schema errors in this wrapper object, so that we can get all errors (error codes) of a specific element. This is useful for PSVI. 
protected static class  XMLSchemaValidator.XPathMatcherStack  / // xpath matcher information /** Stack of XPath matchers for identity constraints. 
abstract protected class  XMLSchemaValidator.ValueStoreBase  Value store implementation base class. There are specific subclasses for handling unique, key, and keyref. 
protected class  XMLSchemaValidator.UniqueValueStore  Unique value store. 
protected class  XMLSchemaValidator.KeyValueStore  Key value store. 
protected class  XMLSchemaValidator.KeyRefValueStore  Key reference value store. 
protected class  XMLSchemaValidator.ValueStoreCache  Value store cache. This class is used to store the values for identity constraints. 
protected static final class  XMLSchemaValidator.LocalIDKey   
protected static final class  XMLSchemaValidator.ShortVector  A simple vector for shorts. 
Field Summary
protected static final  String VALIDATION    Feature identifier: validation. 
protected static final  String SCHEMA_VALIDATION    Feature identifier: validation. 
protected static final  String SCHEMA_FULL_CHECKING    Feature identifier: schema full checking 
protected static final  String DYNAMIC_VALIDATION    Feature identifier: dynamic validation. 
protected static final  String NORMALIZE_DATA    Feature identifier: expose schema normalized value 
protected static final  String SCHEMA_ELEMENT_DEFAULT    Feature identifier: send element default value via characters() 
protected static final  String SCHEMA_AUGMENT_PSVI    Feature identifier: augment PSVI 
protected static final  String ALLOW_JAVA_ENCODINGS    Feature identifier: whether to recognize java encoding names 
protected static final  String STANDARD_URI_CONFORMANT_FEATURE    Feature identifier: standard uri conformant feature. 
protected static final  String GENERATE_SYNTHETIC_ANNOTATIONS    Feature: generate synthetic annotations 
protected static final  String VALIDATE_ANNOTATIONS    Feature identifier: validate annotations. 
protected static final  String HONOUR_ALL_SCHEMALOCATIONS    Feature identifier: honour all schemaLocations 
protected static final  String USE_GRAMMAR_POOL_ONLY    Feature identifier: use grammar pool only 
protected static final  String CONTINUE_AFTER_FATAL_ERROR    Feature identifier: whether to continue parsing a schema after a fatal error is encountered 
protected static final  String PARSER_SETTINGS     
protected static final  String IGNORE_XSI_TYPE    Feature identifier: whether to ignore xsi:type attributes until a global element declaration is encountered 
protected static final  String ID_IDREF_CHECKING    Feature identifier: whether to ignore ID/IDREF errors 
protected static final  String UNPARSED_ENTITY_CHECKING    Feature identifier: whether to ignore unparsed entity errors 
protected static final  String IDENTITY_CONSTRAINT_CHECKING    Feature identifier: whether to ignore identity constraint errors 
public static final  String SYMBOL_TABLE    Property identifier: symbol table. 
public static final  String ERROR_REPORTER    Property identifier: error reporter. 
public static final  String ENTITY_RESOLVER    Property identifier: entity resolver. 
public static final  String XMLGRAMMAR_POOL    Property identifier: grammar pool. 
protected static final  String VALIDATION_MANAGER     
protected static final  String ENTITY_MANAGER     
protected static final  String SCHEMA_LOCATION    Property identifier: schema location. 
protected static final  String SCHEMA_NONS_LOCATION    Property identifier: no namespace schema location. 
protected static final  String JAXP_SCHEMA_SOURCE    Property identifier: JAXP schema source. 
protected static final  String JAXP_SCHEMA_LANGUAGE    Property identifier: JAXP schema language. 
protected static final  String ROOT_TYPE_DEF    Property identifier: root type definition. 
protected static final  int ID_CONSTRAINT_NUM     
static final  XSAttributeDecl XSI_TYPE     
static final  XSAttributeDecl XSI_NIL     
static final  XSAttributeDecl XSI_SCHEMALOCATION     
static final  XSAttributeDecl XSI_NONAMESPACESCHEMALOCATION     
protected  ElementPSVImpl fCurrentPSVI    current PSVI element info 
protected final  AugmentationsImpl fAugmentations     
protected  XMLString fDefaultValue     
protected  boolean fDynamicValidation     
protected  boolean fSchemaDynamicValidation     
protected  boolean fDoValidation     
protected  boolean fFullChecking     
protected  boolean fNormalizeData     
protected  boolean fSchemaElementDefault     
protected  boolean fAugPSVI     
protected  boolean fIdConstraint     
protected  boolean fUseGrammarPoolOnly     
protected  boolean fEntityRef     
protected  boolean fInCDATA     
protected  SymbolTable fSymbolTable    Symbol table. 
protected final  XMLSchemaValidator.XSIErrorReporter fXSIErrorReporter    Error reporter. 
protected  XMLEntityResolver fEntityResolver    Entity resolver 
protected  ValidationManager fValidationManager     
protected  ConfigurableValidationState fValidationState     
protected  XMLGrammarPool fGrammarPool     
protected  String fExternalSchemas     
protected  String fExternalNoNamespaceSchema     
protected  Object fJaxpSchemaSource     
protected final  XSDDescription fXSDDescription    Schema Grammar Description passed, to give a chance to application to supply the Grammar 
protected final  Hashtable fLocationPairs     
protected  XMLDocumentHandler fDocumentHandler    Document handler. 
protected  XMLDocumentSource fDocumentSource     
static final  int INITIAL_STACK_SIZE     
static final  int INC_STACK_SIZE     
protected  XMLSchemaValidator.XPathMatcherStack fMatcherStack    Stack of active XPath matchers for identity constraints. All active XPath matchers are notified of startElement and endElement callbacks in order to perform their matches.

For each element with identity constraints, the selector of each identity constraint is activated. When the selector matches its XPath, then all the fields of the identity constraint are activated.

Note: Once the activation scope is left, the XPath matchers are automatically removed from the stack of active matchers and no longer receive callbacks. 

protected  XMLSchemaValidator.ValueStoreCache fValueStoreCache    Cache of value stores for identity constraint fields. 
Constructor:
 public XMLSchemaValidator() 
Method from org.apache.xerces.impl.xs.XMLSchemaValidator Summary:
activateField,   addDefaultAttributes,   characterData,   characters,   comment,   doctypeDecl,   elementDefault,   elementLocallyValidComplexType,   elementLocallyValidType,   emptyElement,   endCDATA,   endDocument,   endElement,   endElementPSVI,   endGeneralEntity,   endValueScopeFor,   ensureStackCapacity,   findSchemaGrammar,   getAndCheckXsiType,   getDocumentHandler,   getDocumentSource,   getEmptyAugs,   getFeatureDefault,   getPropertyDefault,   getRecognizedFeatures,   getRecognizedProperties,   getXsiNil,   handleCharacters,   handleEndDocument,   handleEndElement,   handleIgnorableWhitespace,   handleStartDocument,   handleStartElement,   ignorableWhitespace,   processAttributes,   processElementContent,   processOneAttribute,   processingInstruction,   reportSchemaError,   reset,   setDocumentHandler,   setDocumentSource,   setFeature,   setProperty,   startCDATA,   startDocument,   startElement,   startGeneralEntity,   startValueScopeFor,   storeLocations,   textDecl,   xmlDecl
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xerces.impl.xs.XMLSchemaValidator Detail:
 public XPathMatcher activateField(Field field,
    int initialDepth) 
    Request to activate the specified field. This method returns the matcher for the field.
  void addDefaultAttributes(QName element,
    XMLAttributes attributes,
    XSAttributeGroupDecl attrGrp) 
 public boolean characterData(String data,
    Augmentations augs) 
 public  void characters(XMLString text,
    Augmentations augs) throws XNIException 
    Character content.
 public  void comment(XMLString text,
    Augmentations augs) throws XNIException 
    A comment.
 public  void doctypeDecl(String rootElement,
    String publicId,
    String systemId,
    Augmentations augs) throws XNIException 
    Notifies of the presence of the DOCTYPE line in the document.
 public  void elementDefault(String data) 
 Object elementLocallyValidComplexType(QName element,
    Object textContent) 
 Object elementLocallyValidType(QName element,
    Object textContent) 
 public  void emptyElement(QName element,
    XMLAttributes attributes,
    Augmentations augs) throws XNIException 
    An empty element.
 public  void endCDATA(Augmentations augs) throws XNIException 
    The end of a CDATA section.
 public  void endDocument(Augmentations augs) throws XNIException 
    The end of the document.
 public  void endElement(QName element,
    Augmentations augs) throws XNIException 
    The end of an element.
 final Augmentations endElementPSVI(boolean root,
    SchemaGrammar[] grammars,
    Augmentations augs) 
 public  void endGeneralEntity(String name,
    Augmentations augs) throws XNIException 
    This method notifies the end of a general entity.

    Note: This method is not called for entity references appearing as part of attribute values.

 public  void endValueScopeFor(IdentityConstraint identityConstraint,
    int initialDepth) 
    Ends the value scope for the specified identity constraint.
  void ensureStackCapacity() 
    ensure element stack capacity
 SchemaGrammar findSchemaGrammar(short contextType,
    String namespace,
    QName enclosingElement,
    QName triggeringComponet,
    XMLAttributes attributes) 
 XSTypeDefinition getAndCheckXsiType(QName element,
    String xsiType,
    XMLAttributes attributes) 
 public XMLDocumentHandler getDocumentHandler() 
    Returns the document handler
 public XMLDocumentSource getDocumentSource() 
    Returns the document source
 Augmentations getEmptyAugs(Augmentations augs) 
 public Boolean getFeatureDefault(String featureId) 
    Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
 public Object getPropertyDefault(String propertyId) 
    Returns the default state for a property, or null if this component does not want to report a default value for this property.
 public String[] getRecognizedFeatures() 
    Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.
 public String[] getRecognizedProperties() 
    Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.
 boolean getXsiNil(QName element,
    String xsiNil) 
 XMLString handleCharacters(XMLString text) 
  void handleEndDocument() 
 Augmentations handleEndElement(QName element,
    Augmentations augs) 
    Handle end element. If there is not text content, and there is a {value constraint} on the corresponding element decl, then set the fDefaultValue XMLString representing the default value.
  void handleIgnorableWhitespace(XMLString text) 
  void handleStartDocument(XMLLocator locator,
    String encoding) 
 Augmentations handleStartElement(QName element,
    XMLAttributes attributes,
    Augmentations augs) 
    Handle element.
 public  void ignorableWhitespace(XMLString text,
    Augmentations augs) throws XNIException 
    Ignorable whitespace. For this method to be called, the document source must have some way of determining that the text containing only whitespace characters should be considered ignorable. For example, the validator can determine if a length of whitespace characters in the document are ignorable based on the element content model.
  void processAttributes(QName element,
    XMLAttributes attributes,
    XSAttributeGroupDecl attrGrp) 
  void processElementContent(QName element) 
    If there is not text content, and there is a {value constraint} on the corresponding element decl, then return an XMLString representing the default value.
  void processOneAttribute(QName element,
    XMLAttributes attributes,
    int index,
    XSAttributeDecl currDecl,
    XSAttributeUseImpl currUse,
    AttributePSVImpl attrPSVI) 
 public  void processingInstruction(String target,
    XMLString data,
    Augmentations augs) throws XNIException 
    A processing instruction. Processing instructions consist of a target name and, optionally, text data. The data is only meaningful to the application.

    Typically, a processing instruction's data will contain a series of pseudo-attributes. These pseudo-attributes follow the form of element attributes but are not parsed or presented to the application as anything other than text. The application is responsible for parsing the data.

  void reportSchemaError(String key,
    Object[] arguments) 
 public  void reset(XMLComponentManager componentManager) throws XMLConfigurationException 
 public  void setDocumentHandler(XMLDocumentHandler documentHandler) 
    Sets the document handler to receive information about the document.
 public  void setDocumentSource(XMLDocumentSource source) 
    Sets the document source
 public  void setFeature(String featureId,
    boolean state) throws XMLConfigurationException 
    Sets the state of a feature. This method is called by the component manager any time after reset when a feature changes state.

    Note: Components should silently ignore features that do not affect the operation of the component.

 public  void setProperty(String propertyId,
    Object value) throws XMLConfigurationException 
    Sets the value of a property. This method is called by the component manager any time after reset when a property changes value.

    Note: Components should silently ignore properties that do not affect the operation of the component.

 public  void startCDATA(Augmentations augs) throws XNIException 
    The start of a CDATA section.
 public  void startDocument(XMLLocator locator,
    String encoding,
    NamespaceContext namespaceContext,
    Augmentations augs) throws XNIException 
    The start of the document.
 public  void startElement(QName element,
    XMLAttributes attributes,
    Augmentations augs) throws XNIException 
    The start of an element.
 public  void startGeneralEntity(String name,
    XMLResourceIdentifier identifier,
    String encoding,
    Augmentations augs) throws XNIException 
    This method notifies the start of a general entity.

    Note: This method is not called for entity references appearing as part of attribute values.

 public  void startValueScopeFor(IdentityConstraint identityConstraint,
    int initialDepth) 
    Start the value scope for the specified identity constraint. This method is called when the selector matches in order to initialize the value store.
  void storeLocations(String sLocation,
    String nsLocation) 
 public  void textDecl(String version,
    String encoding,
    Augmentations augs) throws XNIException 
    Notifies of the presence of a TextDecl line in an entity. If present, this method will be called immediately following the startEntity call.

    Note: This method will never be called for the document entity; it is only called for external general entities referenced in document content.

    Note: This method is not called for entity references appearing as part of attribute values.

 public  void xmlDecl(String version,
    String encoding,
    String standalone,
    Augmentations augs) throws XNIException 
    Notifies of the presence of an XMLDecl line in the document. If present, this method will be called immediately following the startDocument call.