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

pack-priv final Class StAXValidatorHelper

extends Object
implements ValidatorHelper, EntityState
Class Inheritance
All Implemented Interfaces
org.apache.xerces.impl.validation.EntityState, org.apache.xerces.jaxp.validation.ValidatorHelper
Imports
java.io.IOException, java.util.ArrayList, .HashMap, .Iterator, .List, javax.xml.stream.Location, .XMLEventReader, .XMLStreamConstants, .XMLStreamException, .XMLStreamReader, .XMLStreamWriter, javax.xml.stream.events.Attribute, .Characters, .Comment, .DTD, .EndDocument, .EndElement, .EntityDeclaration, .EntityReference, .Namespace, .ProcessingInstruction, .StartDocument, .StartElement, .XMLEvent, javax.xml.transform.Result, .Source, javax.xml.transform.stax.StAXResult, .StAXSource, org.apache.xerces.impl.Constants, .XMLErrorReporter, org.apache.xerces.impl.validation.EntityState, .ValidationManager, org.apache.xerces.impl.xs.XMLSchemaValidator, org.apache.xerces.util.JAXPNamespaceContextWrapper, .StAXLocationWrapper, .SymbolTable, .XMLAttributesImpl, .XMLStringBuffer, .XMLSymbols, org.apache.xerces.xni.QName, .XMLString, .XNIException, org.apache.xerces.xni.parser.XMLParseException, org.xml.sax.SAXException

A validator helper for StAXSources.

Author
Michael Glavassevich, IBM
Version
$Id: StAXValidatorHelper.java 1667114 2015-03-16 19:51:30Z mrglavas $

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
StAXValidatorHelper.EventHelper

Helper for XMLEventReaders.

pack-priv class
StAXValidatorHelper.StreamHelper

Helper for XMLStreamReaders.

pack-priv static class
StAXValidatorHelper.XMLStreamReaderLocation

On demand reader of the Location from an XMLStreamReader.

Field Summary

Modifier and TypeField and Description
private static final String
ERROR_REPORTER

Property identifier: error reporter.

pack-priv final QName
pack-priv final XMLAttributesImpl
private final XMLSchemaValidatorComponentManager
fComponentManager

Component manager.

private XMLEvent
fCurrentEvent

Current event.

pack-priv final ArrayList<E>
private int
fDepth

Document depth.

pack-priv final QName
fElementQName

Fields for start element, end element and characters.

private HashMap<K, V>
fEntities

Map for tracking entity declarations.

private final XMLErrorReporter
fErrorReporter

Error reporter.

private StAXValidatorHelper.EventHelper
fEventHelper

Validator helper for XMLEventReaders.

private final JAXPNamespaceContextWrapper
fNamespaceContext

The namespace context of this document: stores namespaces in scope.

private final XMLSchemaValidator
fSchemaValidator

Schema validator.

private StAXEventResultBuilder
fStAXEventResultBuilder

StAX event result builder.

private final StAXLocationWrapper
fStAXLocationWrapper

XML Locator wrapper for StAX.

private StAXStreamResultBuilder
fStAXStreamResultBuilder

StAX stream result builder.

private StAXDocumentHandler
fStAXValidatorHandler

StAX document handler.

private StAXValidatorHelper.StreamHelper
fStreamHelper

Validator helper for XMLStreamReaders.

pack-priv final XMLStringBuffer
private boolean
fStringsInternalized

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

private final SymbolTable
fSymbolTable

Symbol table

pack-priv final XMLString
private final ValidationManager
fValidationManager

Validation manager.

private final StAXValidatorHelper.XMLStreamReaderLocation
fXMLStreamReaderLocation

On demand reader of the Location from an XMLStreamReader.

private static final String
SCHEMA_VALIDATOR

Property identifier: XML Schema validator.

private static final String
STRING_INTERNING

Property identifier: string interning.

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

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
fillQName(QName toFill, String uri, String localpart, String prefix)

Fills in a QName object.

pack-priv final XMLEvent
pack-priv final EntityDeclaration
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.
pack-priv final void
processEntityDeclarations(List<E> entityDecls)

Copies entity declarations into a hash map.

pack-priv final void
setup(Location location, StAXResult result, boolean stringsInternalized)

Setup for validation.

private void
setupStAXResultHandler(StAXResult result)

Sets up handler for StAXResult.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ERROR_REPORTERback to summary
private static final String ERROR_REPORTER

Property identifier: error reporter.

fAttributeQNameback to summary
pack-priv final QName fAttributeQName
fAttributesback to summary
pack-priv final XMLAttributesImpl fAttributes
fComponentManagerback to summary
private final XMLSchemaValidatorComponentManager fComponentManager

Component manager.

fCurrentEventback to summary
private XMLEvent fCurrentEvent

Current event.

fDeclaredPrefixesback to summary
pack-priv final ArrayList<E> fDeclaredPrefixes
fDepthback to summary
private int fDepth

Document depth.

fElementQNameback to summary
pack-priv final QName fElementQName

Fields for start element, end element and characters.

fEntitiesback to summary
private HashMap<K, V> fEntities

Map for tracking entity declarations.

fErrorReporterback to summary
private final XMLErrorReporter fErrorReporter

Error reporter.

fEventHelperback to summary
private StAXValidatorHelper.EventHelper fEventHelper

Validator helper for XMLEventReaders.

fNamespaceContextback to summary
private final JAXPNamespaceContextWrapper fNamespaceContext

The namespace context of this document: stores namespaces in scope.

fSchemaValidatorback to summary
private final XMLSchemaValidator fSchemaValidator

Schema validator.

fStAXEventResultBuilderback to summary
private StAXEventResultBuilder fStAXEventResultBuilder

StAX event result builder.

fStAXLocationWrapperback to summary
private final StAXLocationWrapper fStAXLocationWrapper

XML Locator wrapper for StAX.

fStAXStreamResultBuilderback to summary
private StAXStreamResultBuilder fStAXStreamResultBuilder

StAX stream result builder.

fStAXValidatorHandlerback to summary
private StAXDocumentHandler fStAXValidatorHandler

StAX document handler.

fStreamHelperback to summary
private StAXValidatorHelper.StreamHelper fStreamHelper

Validator helper for XMLStreamReaders.

fStringBufferback to summary
pack-priv final XMLStringBuffer fStringBuffer
fStringsInternalizedback to summary
private boolean fStringsInternalized

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

fSymbolTableback to summary
private final SymbolTable fSymbolTable

Symbol table

fTempStringback to summary
pack-priv final XMLString fTempString
fValidationManagerback to summary
private final ValidationManager fValidationManager

Validation manager.

fXMLStreamReaderLocationback to summary
private final StAXValidatorHelper.XMLStreamReaderLocation fXMLStreamReaderLocation

On demand reader of the Location from an XMLStreamReader.

SCHEMA_VALIDATORback to summary
private static final String SCHEMA_VALIDATOR

Property identifier: XML Schema validator.

STRING_INTERNINGback to summary
private static final String STRING_INTERNING

Property identifier: string interning.

SYMBOL_TABLEback to summary
private static final String SYMBOL_TABLE

Property identifier: symbol table.

VALIDATION_MANAGERback to summary
private static final String VALIDATION_MANAGER

Property identifier: validation manager.

Constructor Detail

StAXValidatorHelperback to summary
public StAXValidatorHelper(XMLSchemaValidatorComponentManager componentManager)

Method Detail

fillQNameback to summary
pack-priv final void fillQName(QName toFill, String uri, String localpart, String prefix)

Fills in a QName object.

getCurrentEventback to summary
pack-priv final XMLEvent getCurrentEvent()
getEntityDeclarationback to summary
pack-priv final EntityDeclaration getEntityDeclaration(String name)
isEntityDeclaredback to summary
public boolean isEntityDeclared(String name)

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

Doc from org.apache.xerces.impl.validation.EntityState.isEntityDeclared.

Query method to check if entity with this name was declared.

Returns:boolean

true if name is a declared entity

isEntityUnparsedback to summary
public boolean isEntityUnparsed(String name)

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

Doc from org.apache.xerces.impl.validation.EntityState.isEntityUnparsed.

Query method to check if entity is unparsed.

Returns:boolean

true if name is an unparsed entity

processEntityDeclarationsback to summary
pack-priv final void processEntityDeclarations(List<E> entityDecls)

Copies entity declarations into a hash map.

setupback to summary
pack-priv final void setup(Location location, StAXResult result, boolean stringsInternalized)

Setup for validation.

setupStAXResultHandlerback to summary
private void setupStAXResultHandler(StAXResult result)

Sets up handler for StAXResult.

validateback to summary
public void validate(Source source, Result result) throws SAXException, IOException

Implements org.apache.xerces.jaxp.validation.ValidatorHelper.validate.

org.apache.xerces.jaxp.validation back to summary

pack-priv final Class StAXValidatorHelper.EventHelper

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.xerces.jaxp.validation.StAXValidatorHelper.EventHelper

Helper for XMLEventReaders.

Field Summary

Modifier and TypeField and Description
private static final int
CHUNK_MASK

Chunk mask (CHUNK_SIZE - 1).

private static final int
CHUNK_SIZE

Chunk size (1024).

private final char[]
fCharBuffer

Array for holding character data.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
fillDeclaredPrefixes(StartElement event)

Fills in the list of declared prefixes.

private void
fillDeclaredPrefixes(EndElement event)

Fills in the list of declared prefixes.

private void
fillDeclaredPrefixes(Iterator<E> namespaces)

Fills in the list of declared prefixes.

private void
fillQName(QName toFill, QName toCopy)

Fills in a QName object.

private void
fillXMLAttributes(StartElement event)

Fills in the XMLAttributes object.

private void
sendCharactersToValidator(String str)

Send characters to the validator in CHUNK_SIZE character chunks.

pack-priv final void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHUNK_MASKback to summary
private static final int CHUNK_MASK

Chunk mask (CHUNK_SIZE - 1).

CHUNK_SIZEback to summary
private static final int CHUNK_SIZE

Chunk size (1024).

fCharBufferback to summary
private final char[] fCharBuffer

Array for holding character data.

Constructor Detail

EventHelperback to summary
pack-priv EventHelper()

Method Detail

fillDeclaredPrefixesback to summary
private void fillDeclaredPrefixes(StartElement event)

Fills in the list of declared prefixes.

fillDeclaredPrefixesback to summary
private void fillDeclaredPrefixes(EndElement event)

Fills in the list of declared prefixes.

fillDeclaredPrefixesback to summary
private void fillDeclaredPrefixes(Iterator<E> namespaces)

Fills in the list of declared prefixes.

fillQNameback to summary
private void fillQName(QName toFill, QName toCopy)

Fills in a QName object.

fillXMLAttributesback to summary
private void fillXMLAttributes(StartElement event)

Fills in the XMLAttributes object.

sendCharactersToValidatorback to summary
private void sendCharactersToValidator(String str)

Send characters to the validator in CHUNK_SIZE character chunks.

validateback to summary
pack-priv final void validate(XMLEventReader reader, StAXResult result) throws SAXException, XMLStreamException
org.apache.xerces.jaxp.validation back to summary

pack-priv final Class StAXValidatorHelper.StreamHelper

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.xerces.jaxp.validation.StAXValidatorHelper.StreamHelper

Helper for XMLStreamReaders.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
fillDeclaredPrefixes(XMLStreamReader reader)

Fills in the list of declared prefixes.

private void
fillXMLAttributes(XMLStreamReader reader)

Fills in the XMLAttributes object.

pack-priv final void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StreamHelperback to summary
pack-priv StreamHelper()

Method Detail

fillDeclaredPrefixesback to summary
private void fillDeclaredPrefixes(XMLStreamReader reader)

Fills in the list of declared prefixes.

fillXMLAttributesback to summary
private void fillXMLAttributes(XMLStreamReader reader)

Fills in the XMLAttributes object.

validateback to summary
pack-priv final void validate(XMLStreamReader reader, StAXResult result) throws SAXException, XMLStreamException
org.apache.xerces.jaxp.validation back to summary

pack-priv final Class StAXValidatorHelper.XMLStreamReaderLocation

extends Object
implements Location
Class Inheritance
  • java.lang.Object
  • org.apache.xerces.jaxp.validation.StAXValidatorHelper.XMLStreamReaderLocation
All Implemented Interfaces
javax.xml.stream.Location

On demand reader of the Location from an XMLStreamReader.

Field Summary

Modifier and TypeField and Description
private XMLStreamReader

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
getCharacterOffset()

Implements javax.xml.stream.Location.getCharacterOffset.

Return the byte or character offset into the input source this location is pointing to.
public int
getColumnNumber()

Implements javax.xml.stream.Location.getColumnNumber.

Return the column number where the current event ends, returns -1 if none is available.
public int
getLineNumber()

Implements javax.xml.stream.Location.getLineNumber.

Return the line number where the current event ends, returns -1 if none is available.
private Location
public String
getPublicId()

Implements javax.xml.stream.Location.getPublicId.

Returns the public ID of the XML
public String
getSystemId()

Implements javax.xml.stream.Location.getSystemId.

Returns the system ID of the XML
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

readerback to summary
private XMLStreamReader reader

Constructor Detail

XMLStreamReaderLocationback to summary
public XMLStreamReaderLocation()

Method Detail

getCharacterOffsetback to summary
public int getCharacterOffset()

Implements javax.xml.stream.Location.getCharacterOffset.

Doc from javax.xml.stream.Location.getCharacterOffset.

Return the byte or character offset into the input source this location is pointing to. If the input source is a file or a byte stream then this is the byte offset into that stream, but if the input source is a character media then the offset is the character offset. Returns -1 if there is no offset available.

Returns:int

the current offset

getColumnNumberback to summary
public int getColumnNumber()

Implements javax.xml.stream.Location.getColumnNumber.

Doc from javax.xml.stream.Location.getColumnNumber.

Return the column number where the current event ends, returns -1 if none is available.

Returns:int

the current column number

getLineNumberback to summary
public int getLineNumber()

Implements javax.xml.stream.Location.getLineNumber.

Doc from javax.xml.stream.Location.getLineNumber.

Return the line number where the current event ends, returns -1 if none is available.

Returns:int

the current line number

getLocationback to summary
private Location getLocation()
getPublicIdback to summary
public String getPublicId()

Implements javax.xml.stream.Location.getPublicId.

Doc from javax.xml.stream.Location.getPublicId.

Returns the public ID of the XML

Returns:String

the public ID, or null if not available

getSystemIdback to summary
public String getSystemId()

Implements javax.xml.stream.Location.getSystemId.

Doc from javax.xml.stream.Location.getSystemId.

Returns the system ID of the XML

Returns:String

the system ID, or null if not available

setXMLStreamReaderback to summary
public void setXMLStreamReader(XMLStreamReader reader)