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

pack-priv final Class ValidatorHandlerImpl

extends ValidatorHandler
implements DTDHandler, EntityState, PSVIProvider, ValidatorHelper, XMLDocumentHandler
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.jaxp.validation.ValidatorHelper, org.apache.xerces.xs.PSVIProvider, org.apache.xerces.impl.validation.EntityState, org.xml.sax.DTDHandler
Imports
java.io.IOException, .InputStream, .Reader, .StringReader, java.util.HashMap, javax.xml.parsers.FactoryConfigurationError, .SAXParserFactory, javax.xml.transform.Result, .Source, javax.xml.transform.sax.SAXResult, .SAXSource, javax.xml.validation.TypeInfoProvider, .ValidatorHandler, org.apache.xerces.impl.Constants, .XMLEntityManager, .XMLErrorReporter, org.apache.xerces.impl.dv.XSSimpleType, org.apache.xerces.impl.validation.EntityState, .ValidationManager, org.apache.xerces.impl.xs.XMLSchemaValidator, org.apache.xerces.util.AttributesProxy, .SAXLocatorWrapper, .SAXMessageFormatter, .SymbolTable, .URI, .XMLAttributesImpl, .XMLSymbols, org.apache.xerces.xni.Augmentations, .NamespaceContext, .QName, .XMLAttributes, .XMLDocumentHandler, .XMLLocator, .XMLResourceIdentifier, .XMLString, .XNIException, org.apache.xerces.xni.parser.XMLConfigurationException, .XMLDocumentSource, .XMLParseException, org.apache.xerces.xs.AttributePSVI, .ElementPSVI, .ItemPSVI, .PSVIProvider, .XSTypeDefinition, org.w3c.dom.TypeInfo, org.w3c.dom.ls.LSInput, .LSResourceResolver, org.xml.sax.Attributes, .ContentHandler, .DTDHandler, .ErrorHandler, .InputSource, .Locator, .SAXException, .SAXNotRecognizedException, .SAXNotSupportedException, .XMLReader, org.xml.sax.ext.Attributes2, .EntityResolver2, .LexicalHandler

Implementation of ValidatorHandler for W3C XML Schemas and also a validator helper for SAXSources.

Authors
Kohsuke Kawaguchi ([email protected]), Michael Glavassevich, IBM
Version
$Id: ValidatorHandlerImpl.java 932646 2010-04-09 23:30:29Z mrglavas $

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private class

Field Summary

Modifier and TypeField and Description
private static final String
ERROR_REPORTER

Property identifier: error reporter.

private final AttributesProxy
fAttrAdapter

Deprecated as a consequence of AttributesProxy being deprecated.
private final QName
private final XMLAttributesImpl
private final XMLSchemaValidatorComponentManager
fComponentManager

Component manager.

private ContentHandler
private final QName
fElementQName

Fields for start element, end element and characters.

private final XMLErrorReporter
fErrorReporter

Error reporter.

private final NamespaceContext
fNamespaceContext

The namespace context of this document: stores namespaces in scope

private boolean
fNeedPushNSContext

Flag used to track whether the namespace context needs to be pushed.

private final ValidatorHandlerImpl.ResolutionForwarder
fResolutionForwarder

SAX adapter for an LSResourceResolver.

private final SAXLocatorWrapper
fSAXLocatorWrapper

XML Locator wrapper for SAX.

private final XMLSchemaValidator
fSchemaValidator

Schema validator.

private boolean
fStringsInternalized

Flag used to track whether XML names and Namespace URIs have been internalized.

private final SymbolTable
fSymbolTable

Symbol table

private final XMLString
private final ValidatorHandlerImpl.XMLSchemaTypeInfoProvider
private HashMap<K, V>
fUnparsedEntities

Map for tracking unparsed entities.

private final ValidationManager
fValidationManager

Validation manager.

private static final String
LEXICAL_HANDLER

Property identifier: lexical handler.

private static final String
NAMESPACE_CONTEXT

Property identifier: namespace context.

private static final String
NAMESPACE_PREFIXES

Feature identifier: namespace prefixes.

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
STRING_INTERNING

Feature identifier: string interning.

private static final String
STRINGS_INTERNED

Feature identifier: strings interned.

private static final String
SYMBOL_TABLE

Property identifier: symbol table.

private static final String
VALIDATION_MANAGER

Property identifier: validation manager.

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
characters(XMLString
The content.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.characters.

Character content.
public void
characters(char[]
the characters from the XML document
ch
,
int
the start position in the array
start
,
int
the number of characters to read from the array
length
)

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data.
public void
comment(XMLString
The text in the comment.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.comment.

A comment.
public void
doctypeDecl(String
The name of the root element.
rootElement
,
String
The public identifier if an external DTD or null if the external DTD is specified using SYSTEM.
publicId
,
String
The system identifier if an external DTD, null otherwise.
systemId
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.doctypeDecl.

Notifies of the presence of the DOCTYPE line in the document.
public void
emptyElement(QName
The name of the element.
element
,
XMLAttributes
The element attributes.
attributes
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.emptyElement.

An empty element.
public void
endCDATA(Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.endCDATA.

The end of a CDATA section.
public void
endDocument(Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.endDocument.

The end of the document.
public void
endDocument()

Implements org.xml.sax.ContentHandler.endDocument.

Receive notification of the end of a document.
public void
endElement(QName
The name of the element.
element
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.endElement.

The end of an element.
public void
endElement(String
the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
uri
,
String
the local name (without prefix), or the empty string if Namespace processing is not being performed
localName
,
String
the qualified XML name (with prefix), or the empty string if qualified names are not available
qName
)

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.
public void
endGeneralEntity(String
The name of the entity.
name
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.endGeneralEntity.

This method notifies the end of a general entity.
public void
endPrefixMapping(String
the prefix that was being mapped. This is the empty string when a default mapping scope ends.
prefix
)

Implements org.xml.sax.ContentHandler.endPrefixMapping.

End the scope of a prefix-URI mapping.
private void
fillQName(QName toFill, String uri, String localpart, String raw)

Fills in a QName object.

private void
fillXMLAttribute(Attributes att, int index)

Adds an attribute to the XMLAttributes object.

private void
fillXMLAttributes(Attributes att)

Fills in the XMLAttributes object.

private void
fillXMLAttributes2(Attributes2 att)

Fills in the XMLAttributes object.

public AttributePSVI
getAttributePSVI(int
The attribute index.
index
)

Implements org.apache.xerces.xs.PSVIProvider.getAttributePSVI.

Provides AttributePSVI given the index of an attribute information item in the current element's attribute list.
public AttributePSVI
getAttributePSVIByName(String
The namespace name of an attribute.
uri
,
String
The local name of an attribute.
localname
)

Implements org.apache.xerces.xs.PSVIProvider.getAttributePSVIByName.

Provides AttributePSVI given the namespace name and the local name of an attribute information item in the current element's attribute list.
public ContentHandler
getContentHandler()

Implements abstract javax.xml.validation.ValidatorHandler.getContentHandler.

Gets the ContentHandler which receives the augmented validation result.
public XMLDocumentSource
public ElementPSVI
getElementPSVI()

Implements org.apache.xerces.xs.PSVIProvider.getElementPSVI.

Provides the post schema validation item for the current element information item.
public ErrorHandler
public boolean
getFeature(String
The feature name, which is a non-null fully-qualified URI.
name
)

Overrides javax.xml.validation.ValidatorHandler.getFeature.

Look up the value of a feature flag.
public Object
getProperty(String
The property name, which is a non-null fully-qualified URI.
name
)

Overrides javax.xml.validation.ValidatorHandler.getProperty.

Look up the value of a property.
public LSResourceResolver
public TypeInfoProvider
public void
ignorableWhitespace(XMLString
The ignorable whitespace.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.ignorableWhitespace.

Ignorable whitespace.
public void
ignorableWhitespace(char[]
the characters from the XML document
ch
,
int
the start position in the array
start
,
int
the number of characters to read from the array
length
)

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.
public boolean
isEntityDeclared(String name)

Implements org.apache.xerces.impl.validation.EntityState.isEntityDeclared.

Query method to check if entity with this name was declared.
public boolean
isEntityUnparsed(String name)

Implements org.apache.xerces.impl.validation.EntityState.isEntityUnparsed.

Query method to check if entity is unparsed.
public void
notationDecl(String
The notation name.
name
,
String
The notation's public identifier, or null if none was given.
publicId
,
String
The notation's system identifier, or null if none was given.
systemId
)

Implements org.xml.sax.DTDHandler.notationDecl.

Receive notification of a notation declaration event.
public void
processingInstruction(String
The target.
target
,
XMLString
The data or null if none specified.
data
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.processingInstruction.

A processing instruction.
public void
processingInstruction(String
the processing instruction target
target
,
String
the processing instruction data, or null if none was supplied. The data does not include any whitespace separating it from the target
data
)

Implements org.xml.sax.ContentHandler.processingInstruction.

Receive notification of a processing instruction.
public void
setContentHandler(ContentHandler
A ContentHandler or a null value.
receiver
)

Implements abstract javax.xml.validation.ValidatorHandler.setContentHandler.

Sets the ContentHandler which receives the augmented validation result.
public void
setDocumentLocator(Locator
an object that can return the location of any SAX document event
locator
)

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Receive an object for locating the origin of SAX document events.
public void
public void
setErrorHandler(ErrorHandler
A new error handler to be set. This parameter can be null.
errorHandler
)

Implements abstract javax.xml.validation.ValidatorHandler.setErrorHandler.

Sets the ErrorHandler to receive errors encountered during the validation.
public void
setFeature(String
The feature name, which is a non-null fully-qualified URI.
name
,
boolean
The requested value of the feature (true or false).
value
)

Overrides javax.xml.validation.ValidatorHandler.setFeature.

Set a feature for this ValidatorHandler.

public void
setProperty(String
The property name, which is a non-null fully-qualified URI.
name
,
Object
The requested value for the property.
object
)

Overrides javax.xml.validation.ValidatorHandler.setProperty.

Set the value of a property.
public void
setResourceResolver(LSResourceResolver
A new resource resolver to be set. This parameter can be null.
resourceResolver
)

Implements abstract javax.xml.validation.ValidatorHandler.setResourceResolver.

Sets the LSResourceResolver to customize resource resolution while in a validation episode.
public void
skippedEntity(String
the name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]"
name
)

Implements org.xml.sax.ContentHandler.skippedEntity.

Receive notification of a skipped entity.
public void
startCDATA(Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.startCDATA.

The start of a CDATA section.
public void
startDocument(XMLLocator
The document locator, or null if the document location cannot be reported during the parsing of this document. However, it is strongly recommended that a locator be supplied that can at least report the system identifier of the document.
locator
,
String
The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader).
encoding
,
NamespaceContext
The namespace context in effect at the start of this document. This object represents the current context. Implementors of this class are responsible for copying the namespace bindings from the the current context (and its parent contexts) if that information is important.
namespaceContext
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.startDocument.

The start of the document.
public void
startDocument()

Implements org.xml.sax.ContentHandler.startDocument.

Receive notification of the beginning of a document.
public void
startElement(QName
The name of the element.
element
,
XMLAttributes
The element attributes.
attributes
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.startElement.

The start of an element.
public void
startElement(String
the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
uri
,
String
the local name (without prefix), or the empty string if Namespace processing is not being performed
localName
,
String
the qualified name (with prefix), or the empty string if qualified names are not available
qName
,
Attributes
the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined
atts
)

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element.
public void
startGeneralEntity(String
The name of the general entity.
name
,
XMLResourceIdentifier
The resource identifier.
identifier
,
String
The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader).
encoding
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.startGeneralEntity.

This method notifies the start of a general entity.
public void
startPrefixMapping(String
the Namespace prefix being declared. An empty string is used for the default element namespace, which has no prefix.
prefix
,
String
the Namespace URI the prefix is mapped to
uri
)

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping.
public void
textDecl(String
The XML version, or null if not specified.
version
,
String
The IANA encoding name of the entity.
encoding
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.textDecl.

Notifies of the presence of a TextDecl line in an entity.
public void
unparsedEntityDecl(String
The unparsed entity's name.
name
,
String
The entity's public identifier, or null if none was given.
publicId
,
String
The entity's system identifier.
systemId
,
String
The name of the associated notation.
notationName
)

Implements org.xml.sax.DTDHandler.unparsedEntityDecl.

Receive notification of an unparsed entity declaration event.
public void
public void
xmlDecl(String
The XML version.
version
,
String
The IANA encoding name of the document, or null if not specified.
encoding
,
String
The standalone value, or null if not specified.
standalone
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Implements org.apache.xerces.xni.XMLDocumentHandler.xmlDecl.

Notifies of the presence of an XMLDecl line in the document.