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

pack-priv final Class JAXPValidatorComponent

extends TeeXMLDocumentFilterImpl
implements XMLComponent
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xni.parser.XMLComponent
Imports
java.io.IOException, javax.xml.validation.TypeInfoProvider, .ValidatorHandler, org.apache.xerces.dom.DOMInputImpl, org.apache.xerces.impl.Constants, .XMLErrorReporter, org.apache.xerces.impl.xs.opti.DefaultXMLDocumentHandler, org.apache.xerces.util.AttributesProxy, .AugmentationsImpl, .ErrorHandlerProxy, .ErrorHandlerWrapper, .LocatorProxy, .SymbolTable, .XMLResourceIdentifierImpl, org.apache.xerces.xni.Augmentations, .NamespaceContext, .QName, .XMLAttributes, .XMLDocumentHandler, .XMLLocator, .XMLString, .XNIException, org.apache.xerces.xni.parser.XMLComponent, .XMLComponentManager, .XMLConfigurationException, .XMLEntityResolver, .XMLErrorHandler, .XMLInputSource, org.w3c.dom.TypeInfo, org.w3c.dom.ls.LSInput, .LSResourceResolver, org.xml.sax.Attributes, .ContentHandler, .ErrorHandler, .SAXException, .SAXParseException, org.xml.sax.helpers.DefaultHandler

Runs events through a javax.xml.validation.ValidatorHandler and performs validation/infoset-augmentation by an external validator.

This component sets up the pipeline as follows:

            __                                           __
           /  |==> XNI2SAX --> Validator --> SAX2XNI ==>|  
          /   |                                         |   
      ==>| Tee|                                         | next
          \   |                                         |  component
           \  |============other XNI events============>|  
            ~~                                           ~~

only those events that need to go through Validator will go the 1st route, and other events go the 2nd direct route.

Author
Kohsuke Kawaguchi ([email protected])
Version
$Id: JAXPValidatorComponent.java 548088 2007-06-17 18:25:17Z mrglavas $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class
JAXPValidatorComponent.SAX2XNI

Uses DefaultHandler as a default implementation of ContentHandler.

private static class

Field Summary

Modifier and TypeField and Description
private static final String
ENTITY_MANAGER

Property identifier: entity manager.

private static final String
ERROR_REPORTER

Property identifier: error reporter.

private XMLAttributes
private Augmentations
fCurrentAug

Used to store the Augmentations associated with the current event, so that we can pick it up again when the event is forwarded by the ValidatorHandler.

private XMLEntityResolver
private XMLErrorReporter
private SymbolTable
private static final TypeInfoProvider
noInfoProvider

TypeInfoProvider that returns no info.

private final JAXPValidatorComponent.SAX2XNI
private static final String
SYMBOL_TABLE

Property identifier: symbol table.

private final TypeInfoProvider
private final ValidatorHandler
private final JAXPValidatorComponent.XNI2SAX

Constructor Summary

AccessConstructor and Description
public
JAXPValidatorComponent(ValidatorHandler
may not be null.
validatorHandler
)

Method Summary

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

Overrides org.apache.xerces.jaxp.TeeXMLDocumentFilterImpl.characters.

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

Character content.
public void
emptyElement(QName
The name of the element.
element
,
XMLAttributes
The element attributes.
attributes
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.jaxp.TeeXMLDocumentFilterImpl.emptyElement.

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

An empty element.
public void
endElement(QName
The name of the element.
element
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.jaxp.TeeXMLDocumentFilterImpl.endElement.

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

The end of an element.
public Boolean
getFeatureDefault(String
The feature identifier.
featureId
)

Implements org.apache.xerces.xni.parser.XMLComponent.getFeatureDefault.

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
The property identifier.
propertyId
)

Implements org.apache.xerces.xni.parser.XMLComponent.getPropertyDefault.

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()

Implements org.apache.xerces.xni.parser.XMLComponent.getRecognizedFeatures.

Returns a list of feature identifiers that are recognized by this component.
public String[]
getRecognizedProperties()

Implements org.apache.xerces.xni.parser.XMLComponent.getRecognizedProperties.

Returns a list of property identifiers that are recognized by this component.
public void
ignorableWhitespace(XMLString
The ignorable whitespace.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.jaxp.TeeXMLDocumentFilterImpl.ignorableWhitespace.

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

Ignorable whitespace.
public void
reset(XMLComponentManager
The component manager.
componentManager
)

Implements org.apache.xerces.xni.parser.XMLComponent.reset.

Resets the component.
public void
setFeature(String
The feature identifier.
featureId
,
boolean
The state of the feature.
state
)

Implements org.apache.xerces.xni.parser.XMLComponent.setFeature.

Sets the state of a feature.
public void
setProperty(String
The property identifier.
propertyId
,
Object
The value of the property.
value
)

Implements org.apache.xerces.xni.parser.XMLComponent.setProperty.

Sets the value of a property.
public void
startElement(QName
The name of the element.
element
,
XMLAttributes
The element attributes.
attributes
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.jaxp.TeeXMLDocumentFilterImpl.startElement.

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

The start of an element.
private String
private void
updateAttributes(Attributes atts)

Compares the given Attributes with fCurrentAttributes and update the latter accordingly.

Inherited from org.apache.xerces.jaxp.TeeXMLDocumentFilterImpl:
commentdoctypeDeclendCDATAendDocumentendGeneralEntitygetDocumentHandlergetDocumentSourcegetSideprocessingInstructionsetDocumentHandlersetDocumentSourcesetSidestartCDATAstartDocumentstartGeneralEntitytextDeclxmlDecl