| java.lang.Object org.apache.xerces.impl.xs.XMLSchemaValidator
XMLSchemaValidator | public class XMLSchemaValidator implements XMLComponent,XMLDocumentFilter,FieldActivator,RevalidationHandler(Code) | | 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:
- http://xml.org/sax/features/validation
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-reporter
- http://apache.org/xml/properties/internal/entity-resolver
author: Sandy Gao IBM author: Elena Litani IBM author: Andy Clark IBM author: Neeraj Bajaj, Sun Microsystems, inc. version: $Id: XMLSchemaValidator.java 548089 2007-06-17 18:29:01Z mrglavas $ |
Inner Class :final protected class XSIErrorReporter | |
Inner Class :protected static class XPathMatcherStack | |
Inner Class :abstract protected class ValueStoreBase implements ValueStore | |
Inner Class :protected class UniqueValueStore extends ValueStoreBase | |
Inner Class :protected class KeyValueStore extends ValueStoreBase | |
Inner Class :protected class KeyRefValueStore extends ValueStoreBase | |
Inner Class :protected class ValueStoreCache | |
Inner Class :final protected static class LocalIDKey | |
Inner Class :final protected static class ShortVector | |
Method Summary | |
public XPathMatcher | activateField(Field field, int initialDepth) Request to activate the specified field. | void | addDefaultAttributes(QName element, XMLAttributes attributes, XSAttributeGroupDecl attrGrp) | public boolean | characterData(String data, Augmentations augs) | public void | characters(XMLString text, Augmentations augs) Character content. | public void | comment(XMLString text, Augmentations augs) A comment. | public void | doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs) 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) An empty element. | public void | endCDATA(Augmentations augs) The end of a CDATA section. | public void | endDocument(Augmentations augs) The end of the document. | public void | endElement(QName element, Augmentations augs) The end of an element. | final Augmentations | endElementPSVI(boolean root, SchemaGrammar[] grammars, Augmentations augs) | public void | endGeneralEntity(String name, Augmentations augs) This method notifies the end of a general entity. | public void | endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) Ends the value scope for the specified identity constraint. | void | ensureStackCapacity() | SchemaGrammar | findSchemaGrammar(short contextType, String namespace, QName enclosingElement, QName triggeringComponet, XMLAttributes attributes) | XSTypeDefinition | getAndCheckXsiType(QName element, String xsiType, XMLAttributes attributes) | public XMLDocumentHandler | getDocumentHandler() | public XMLDocumentSource | getDocumentSource() | 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. | public String[] | getRecognizedProperties() Returns a list of property identifiers that 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. | 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) Ignorable whitespace. | 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) A processing instruction. | void | reportSchemaError(String key, Object[] arguments) | public void | reset(XMLComponentManager componentManager) | public void | setDocumentHandler(XMLDocumentHandler documentHandler) Sets the document handler to receive information about the document. | public void | setDocumentSource(XMLDocumentSource source) | public void | setFeature(String featureId, boolean state) Sets the state of a feature. | public void | setProperty(String propertyId, Object value) Sets the value of a property. | public void | startCDATA(Augmentations augs) The start of a CDATA section. | public void | startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) The start of the document.
Parameters: locator - The system identifier of the entity if the entityis external, null otherwise. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. | public void | startElement(QName element, XMLAttributes attributes, Augmentations augs) The start of an element. | public void | startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) This method notifies the start of a general entity.
Note: This method is not called for entity references
appearing as part of attribute values.
Parameters: name - The name of the general entity. Parameters: identifier - The resource identifier. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. | public void | startValueScopeFor(IdentityConstraint identityConstraint, int initialDepth) Start the value scope for the specified identity constraint. | void | storeLocations(String sLocation, String nsLocation) | public void | textDecl(String version, String encoding, Augmentations augs) Notifies of the presence of a TextDecl line in an entity. | public void | xmlDecl(String version, String encoding, String standalone, Augmentations augs) Notifies of the presence of an XMLDecl line in the document. |
ALLOW_JAVA_ENCODINGS | final protected static String ALLOW_JAVA_ENCODINGS(Code) | | Feature identifier: whether to recognize java encoding names
|
CONTINUE_AFTER_FATAL_ERROR | final protected static String CONTINUE_AFTER_FATAL_ERROR(Code) | | Feature identifier: whether to continue parsing a schema after a fatal error is encountered
|
DYNAMIC_VALIDATION | final protected static String DYNAMIC_VALIDATION(Code) | | Feature identifier: dynamic validation.
|
ENTITY_MANAGER | final protected static String ENTITY_MANAGER(Code) | | |
ENTITY_RESOLVER | final public static String ENTITY_RESOLVER(Code) | | Property identifier: entity resolver.
|
ERROR_REPORTER | final public static String ERROR_REPORTER(Code) | | Property identifier: error reporter.
|
GENERATE_SYNTHETIC_ANNOTATIONS | final protected static String GENERATE_SYNTHETIC_ANNOTATIONS(Code) | | Feature: generate synthetic annotations
|
HONOUR_ALL_SCHEMALOCATIONS | final protected static String HONOUR_ALL_SCHEMALOCATIONS(Code) | | Feature identifier: honour all schemaLocations
|
IDENTITY_CONSTRAINT_CHECKING | final protected static String IDENTITY_CONSTRAINT_CHECKING(Code) | | Feature identifier: whether to ignore identity constraint errors
|
ID_CONSTRAINT_NUM | final protected static int ID_CONSTRAINT_NUM(Code) | | |
ID_IDREF_CHECKING | final protected static String ID_IDREF_CHECKING(Code) | | Feature identifier: whether to ignore ID/IDREF errors
|
IGNORE_XSI_TYPE | final protected static String IGNORE_XSI_TYPE(Code) | | Feature identifier: whether to ignore xsi:type attributes until a global element declaration is encountered
|
INC_STACK_SIZE | final static int INC_STACK_SIZE(Code) | | |
INITIAL_STACK_SIZE | final static int INITIAL_STACK_SIZE(Code) | | |
JAXP_SCHEMA_LANGUAGE | final protected static String JAXP_SCHEMA_LANGUAGE(Code) | | Property identifier: JAXP schema language.
|
JAXP_SCHEMA_SOURCE | final protected static String JAXP_SCHEMA_SOURCE(Code) | | Property identifier: JAXP schema source.
|
NORMALIZE_DATA | final protected static String NORMALIZE_DATA(Code) | | Feature identifier: expose schema normalized value
|
PARSER_SETTINGS | final protected static String PARSER_SETTINGS(Code) | | |
ROOT_TYPE_DEF | final protected static String ROOT_TYPE_DEF(Code) | | Property identifier: root type definition.
|
SCHEMA_AUGMENT_PSVI | final protected static String SCHEMA_AUGMENT_PSVI(Code) | | Feature identifier: augment PSVI
|
SCHEMA_ELEMENT_DEFAULT | final protected static String SCHEMA_ELEMENT_DEFAULT(Code) | | Feature identifier: send element default value via characters()
|
SCHEMA_FULL_CHECKING | final protected static String SCHEMA_FULL_CHECKING(Code) | | Feature identifier: schema full checking
|
SCHEMA_LOCATION | final protected static String SCHEMA_LOCATION(Code) | | Property identifier: schema location.
|
SCHEMA_NONS_LOCATION | final protected static String SCHEMA_NONS_LOCATION(Code) | | Property identifier: no namespace schema location.
|
SCHEMA_VALIDATION | final protected static String SCHEMA_VALIDATION(Code) | | Feature identifier: validation.
|
STANDARD_URI_CONFORMANT_FEATURE | final protected static String STANDARD_URI_CONFORMANT_FEATURE(Code) | | Feature identifier: standard uri conformant feature.
|
SYMBOL_TABLE | final public static String SYMBOL_TABLE(Code) | | Property identifier: symbol table.
|
UNPARSED_ENTITY_CHECKING | final protected static String UNPARSED_ENTITY_CHECKING(Code) | | Feature identifier: whether to ignore unparsed entity errors
|
USE_GRAMMAR_POOL_ONLY | final protected static String USE_GRAMMAR_POOL_ONLY(Code) | | Feature identifier: use grammar pool only
|
VALIDATE_ANNOTATIONS | final protected static String VALIDATE_ANNOTATIONS(Code) | | Feature identifier: validate annotations.
|
VALIDATION | final protected static String VALIDATION(Code) | | Feature identifier: validation.
|
VALIDATION_MANAGER | final protected static String VALIDATION_MANAGER(Code) | | |
XMLGRAMMAR_POOL | final public static String XMLGRAMMAR_POOL(Code) | | Property identifier: grammar pool.
|
fAugPSVI | protected boolean fAugPSVI(Code) | | |
fDoValidation | protected boolean fDoValidation(Code) | | |
fDynamicValidation | protected boolean fDynamicValidation(Code) | | |
fEntityRef | protected boolean fEntityRef(Code) | | |
fExternalNoNamespaceSchema | protected String fExternalNoNamespaceSchema(Code) | | |
fFullChecking | protected boolean fFullChecking(Code) | | |
fIdConstraint | protected boolean fIdConstraint(Code) | | |
fInCDATA | protected boolean fInCDATA(Code) | | |
fMatcherStack | protected XPathMatcherStack fMatcherStack(Code) | | 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.
|
fNormalizeData | protected boolean fNormalizeData(Code) | | |
fSchemaDynamicValidation | protected boolean fSchemaDynamicValidation(Code) | | |
fSchemaElementDefault | protected boolean fSchemaElementDefault(Code) | | |
fUseGrammarPoolOnly | protected boolean fUseGrammarPoolOnly(Code) | | |
fValueStoreCache | protected ValueStoreCache fValueStoreCache(Code) | | Cache of value stores for identity constraint fields.
|
fXSDDescription | final protected XSDDescription fXSDDescription(Code) | | Schema Grammar Description passed, to give a chance to application to supply the Grammar
|
fXSIErrorReporter | final protected XSIErrorReporter fXSIErrorReporter(Code) | | Error reporter.
|
XMLSchemaValidator | public XMLSchemaValidator()(Code) | | Default constructor.
|
activateField | public XPathMatcher activateField(Field field, int initialDepth)(Code) | | Request to activate the specified field. This method returns the
matcher for the field.
Parameters: field - The field to activate. |
characters | public void characters(XMLString text, Augmentations augs) throws XNIException(Code) | | Character content.
Parameters: text - The content. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
comment | public void comment(XMLString text, Augmentations augs) throws XNIException(Code) | | A comment.
Parameters: text - The text in the comment. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by application to signal an error. |
doctypeDecl | public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs) throws XNIException(Code) | | Notifies of the presence of the DOCTYPE line in the document.
Parameters: rootElement - The name of the root element. Parameters: publicId - The public identifier if an external DTD or nullif the external DTD is specified using SYSTEM. Parameters: systemId - The system identifier if an external DTD, nullotherwise. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
emptyElement | public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code) | | An empty element.
Parameters: element - The name of the element. Parameters: attributes - The element attributes. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endCDATA | public void endCDATA(Augmentations augs) throws XNIException(Code) | | The end of a CDATA section.
Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endDocument | public void endDocument(Augmentations augs) throws XNIException(Code) | | The end of the document.
Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endElement | public void endElement(QName element, Augmentations augs) throws XNIException(Code) | | The end of an element.
Parameters: element - The name of the element. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endGeneralEntity | public void endGeneralEntity(String name, Augmentations augs) throws XNIException(Code) | | This method notifies the end of a general entity.
Note: This method is not called for entity references
appearing as part of attribute values.
Parameters: name - The name of the entity. Parameters: augs - Additional information that may include infoset augmentations exception: XNIException - Thrown by handler to signal an error. |
endValueScopeFor | public void endValueScopeFor(IdentityConstraint identityConstraint, int initialDepth)(Code) | | Ends the value scope for the specified identity constraint.
Parameters: identityConstraint - The identity constraint. |
ensureStackCapacity | void ensureStackCapacity()(Code) | | ensure element stack capacity
|
getFeatureDefault | public Boolean getFeatureDefault(String featureId)(Code) | | Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature.
Parameters: featureId - The feature identifier. since: Xerces 2.2.0 |
getPropertyDefault | public Object getPropertyDefault(String propertyId)(Code) | | Returns the default state for a property, or null if this
component does not want to report a default value for this
property.
Parameters: propertyId - The property identifier. since: Xerces 2.2.0 |
getRecognizedFeatures | public String[] getRecognizedFeatures()(Code) | | 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.
|
getRecognizedProperties | public String[] getRecognizedProperties()(Code) | | 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.
|
handleEndDocument | void handleEndDocument()(Code) | | |
handleEndElement | Augmentations handleEndElement(QName element, Augmentations augs)(Code) | | 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.
|
handleIgnorableWhitespace | void handleIgnorableWhitespace(XMLString text)(Code) | | |
ignorableWhitespace | public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException(Code) | | 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.
Parameters: text - The ignorable whitespace. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
processElementContent | void processElementContent(QName element)(Code) | | 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.
|
processingInstruction | public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException(Code) | | 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.
Parameters: target - The target. Parameters: data - The data or null if none specified. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
setDocumentHandler | public void setDocumentHandler(XMLDocumentHandler documentHandler)(Code) | | Sets the document handler to receive information about the document.
|
setFeature | public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code) | | 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.
Parameters: featureId - The feature identifier. Parameters: state - The state of the feature. throws: SAXNotRecognizedException - The component should not throwthis exception. throws: SAXNotSupportedException - The component should not throwthis exception. |
setProperty | public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code) | | 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.
Parameters: propertyId - The property identifier. Parameters: value - The value of the property. throws: SAXNotRecognizedException - The component should not throwthis exception. throws: SAXNotSupportedException - The component should not throwthis exception. |
startCDATA | public void startCDATA(Augmentations augs) throws XNIException(Code) | | The start of a CDATA section.
Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
startDocument | public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException(Code) | | The start of the document.
Parameters: locator - The system identifier of the entity if the entityis external, null otherwise. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. This value will be null in those situationswhere the entity encoding is not auto-detected (e.g.internal entities or a document entity that isparsed from a java.io.Reader). Parameters: namespaceContext - The namespace context in effect at thestart of this document.This object represents the current context.Implementors of this class are responsiblefor copying the namespace bindings from thethe current context (and its parent contexts)if that information is important. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
startElement | public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code) | | The start of an element.
Parameters: element - The name of the element. Parameters: attributes - The element attributes. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
startGeneralEntity | public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException(Code) | | This method notifies the start of a general entity.
Note: This method is not called for entity references
appearing as part of attribute values.
Parameters: name - The name of the general entity. Parameters: identifier - The resource identifier. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. This value will be null in those situationswhere the entity encoding is not auto-detected (e.g.internal entities or a document entity that isparsed from a java.io.Reader). Parameters: augs - Additional information that may include infoset augmentations exception: XNIException - Thrown by handler to signal an error. |
startValueScopeFor | public void startValueScopeFor(IdentityConstraint identityConstraint, int initialDepth)(Code) | | Start the value scope for the specified identity constraint. This
method is called when the selector matches in order to initialize
the value store.
Parameters: identityConstraint - The identity constraint. |
textDecl | public void textDecl(String version, String encoding, Augmentations augs) throws XNIException(Code) | | 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.
Parameters: version - The XML version, or null if not specified. Parameters: encoding - The IANA encoding name of the entity. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
xmlDecl | public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException(Code) | | Notifies of the presence of an XMLDecl line in the document. If
present, this method will be called immediately following the
startDocument call.
Parameters: version - The XML version. Parameters: encoding - The IANA encoding name of the document, or null ifnot specified. Parameters: standalone - The standalone value, or null if not specified. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
|
|