APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.jaxp.validation

pack-priv final Class DOMValidatorHelper

extends Object
implements ValidatorHelper, EntityState
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.impl.validation.EntityState, com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHelper
Imports
com.sun.org.apache.xerces.internal.impl.Constants, .XMLErrorReporter, com.sun.org.apache.xerces.internal.impl.validation.EntityState, .ValidationManager, com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator, com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator, com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl, com.sun.org.apache.xerces.internal.util.NamespaceSupport, .SymbolTable, .XMLAttributesImpl, .XMLSymbols, com.sun.org.apache.xerces.internal.xni.NamespaceContext, .QName, .XMLString, .XNIException, com.sun.org.apache.xerces.internal.xni.parser.XMLParseException, java.io.IOException, java.util.Enumeration, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, .ParserConfigurationException, javax.xml.transform.Result, .Source, javax.xml.transform.dom.DOMResult, .DOMSource, jdk.xml.internal.JdkConstants, .JdkXmlUtils, org.w3c.dom.Attr, .CDATASection, .Comment, .Document, .DocumentType, .Entity, .NamedNodeMap, .Node, .ProcessingInstruction, .Text, org.xml.sax.SAXException

A validator helper for DOMSources.

Author
Michael Glavassevich, IBM

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
DOMValidatorHelper.DOMNamespaceContext

NamespaceContext for the DOMSource, includes context for ancestor nodes.

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 static final String
ERROR_REPORTER

Property identifier: error reporter.

pack-priv final QName
pack-priv final XMLAttributesImpl
private char[]
fCharBuffer

Array for holding character data.

private XMLSchemaValidatorComponentManager
fComponentManager

Component manager.

private Node
fCurrentElement

Current element.

private DOMValidatorHelper.DOMNamespaceContext
fDOMNamespaceContext

The namespace context of the DOMSource, includes context from ancestor nodes.

private final DOMResultAugmentor
fDOMResultAugmentor

DOM result augmentor.

private final DOMResultBuilder
fDOMResultBuilder

DOM result builder.

private DOMDocumentHandler
fDOMValidatorHandler

DOM document handler.

pack-priv final QName
fElementQName

Fields for start element, end element and characters.

private NamedNodeMap
fEntities

Map for tracking unparsed entities.

private XMLErrorReporter
fErrorReporter

Error reporter.

private NamespaceSupport
fNamespaceContext

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

private Node
fRoot

Root node.

private XMLSchemaValidator
fSchemaValidator

Schema validator.

private SymbolTable
fSymbolTable

Symbol table

pack-priv final XMLString
private ValidationManager
fValidationManager

Validation manager.

private final SimpleLocator
fXMLLocator

Simple Locator.

private static final String
NAMESPACE_CONTEXT

Property identifier: namespace context.

private static final String
SCHEMA_VALIDATOR

Property identifier: XML Schema validator.

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
private void
beginNode(Node node)

Do processing for the start of a node.

private void
fillQName(QName toFill, Node node)

private void
finishNode(Node node)

Do processing for the end of a node.

pack-priv Node
public boolean
isEntityDeclared(String name)

Implements com.sun.org.apache.xerces.internal.impl.validation.EntityState.isEntityDeclared.

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

public boolean
private void
private void
private void
setupDOMResultHandler(DOMSource source, DOMResult result)

Sets up handler for DOMResult.

private void
setupEntityMap(Document doc)

Extracts NamedNodeMap of entities.

public void
private void
validate(Node node)

Traverse the DOM and fire events to the schema validator.

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

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
fCharBufferback to summary
private char[] fCharBuffer

Array for holding character data.

fComponentManagerback to summary
private XMLSchemaValidatorComponentManager fComponentManager

Component manager.

fCurrentElementback to summary
private Node fCurrentElement

Current element.

fDOMNamespaceContextback to summary
private DOMValidatorHelper.DOMNamespaceContext fDOMNamespaceContext

The namespace context of the DOMSource, includes context from ancestor nodes.

fDOMResultAugmentorback to summary
private final DOMResultAugmentor fDOMResultAugmentor

DOM result augmentor.

fDOMResultBuilderback to summary
private final DOMResultBuilder fDOMResultBuilder

DOM result builder.

fDOMValidatorHandlerback to summary
private DOMDocumentHandler fDOMValidatorHandler

DOM document handler.

fElementQNameback to summary
pack-priv final QName fElementQName

Fields for start element, end element and characters.

fEntitiesback to summary
private NamedNodeMap fEntities

Map for tracking unparsed entities.

fErrorReporterback to summary
private XMLErrorReporter fErrorReporter

Error reporter.

fNamespaceContextback to summary
private NamespaceSupport fNamespaceContext

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

fRootback to summary
private Node fRoot

Root node.

fSchemaValidatorback to summary
private XMLSchemaValidator fSchemaValidator

Schema validator.

fSymbolTableback to summary
private SymbolTable fSymbolTable

Symbol table

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

Validation manager.

fXMLLocatorback to summary
private final SimpleLocator fXMLLocator

Simple Locator.

NAMESPACE_CONTEXTback to summary
private static final String NAMESPACE_CONTEXT

Property identifier: namespace context.

SCHEMA_VALIDATORback to summary
private static final String SCHEMA_VALIDATOR

Property identifier: XML Schema validator.

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

DOMValidatorHelperback to summary
public DOMValidatorHelper(XMLSchemaValidatorComponentManager componentManager)

Method Detail

beginNodeback to summary
private void beginNode(Node node)

Do processing for the start of a node.

fillQNameback to summary
private void fillQName(QName toFill, Node node)
finishNodeback to summary
private void finishNode(Node node)

Do processing for the end of a node.

getCurrentElementback to summary
pack-priv Node getCurrentElement()
isEntityDeclaredback to summary
public boolean isEntityDeclared(String name)

Implements com.sun.org.apache.xerces.internal.impl.validation.EntityState.isEntityDeclared.

Doc from com.sun.org.apache.xerces.internal.impl.validation.EntityState.isEntityDeclared.

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

isEntityUnparsedback to summary
public boolean isEntityUnparsed(String name)

Implements com.sun.org.apache.xerces.internal.impl.validation.EntityState.isEntityUnparsed.

Doc from com.sun.org.apache.xerces.internal.impl.validation.EntityState.isEntityUnparsed.

Query method to check if entity is unparsed.

processAttributesback to summary
private void processAttributes(NamedNodeMap attrMap)
sendCharactersToValidatorback to summary
private void sendCharactersToValidator(String str)
setupDOMResultHandlerback to summary
private void setupDOMResultHandler(DOMSource source, DOMResult result) throws SAXException

Sets up handler for DOMResult.

setupEntityMapback to summary
private void setupEntityMap(Document doc)

Extracts NamedNodeMap of entities. We need this to validate elements and attributes of type xs:ENTITY, xs:ENTITIES or types dervied from them.

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

Implements com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHelper.validate.

validateback to summary
private void validate(Node node)

Traverse the DOM and fire events to the schema validator.

com.sun.org.apache.xerces.internal.jaxp.validation back to summary

pack-priv final Class DOMValidatorHelper.DOMNamespaceContext

extends Object
implements NamespaceContext
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.DOMNamespaceContext
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xni.NamespaceContext

NamespaceContext for the DOMSource, includes context for ancestor nodes.

Field Summary

Modifier and TypeField and Description
protected boolean
fDOMContextBuilt

Flag indicating whether the namespace context has been from the root node's ancestors.

protected String[]
fNamespace

Namespace binding information.

protected int
fNamespaceSize

The size of the namespace information array.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
private void
private void
public Enumeration<String>
getAllPrefixes()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getAllPrefixes.

Return an enumeration of all prefixes whose declarations are active in the current context.

public String
getDeclaredPrefixAt(int index)

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getDeclaredPrefixAt.

Returns the prefix at the specified index in the current context.

public int
getDeclaredPrefixCount()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getDeclaredPrefixCount.

Return a count of locally declared prefixes, including the default prefix if bound.

public String
getPrefix(String uri)

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getPrefix.

Look up a namespace URI and get one of the mapped prefix.

public String
getURI(String prefix)

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getURI.

Look up a prefix and get the currently-mapped Namespace URI.

private String
getURI0(String prefix)

public void
popContext()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.popContext.

Revert to the previous Namespace context.

public void
public void
reset()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.reset.

Reset this Namespace support object for reuse.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fDOMContextBuiltback to summary
protected boolean fDOMContextBuilt

Flag indicating whether the namespace context has been from the root node's ancestors.

fNamespaceback to summary
protected String[] fNamespace

Namespace binding information. This array is composed of a series of tuples containing the namespace binding information: <prefix, uri>.

fNamespaceSizeback to summary
protected int fNamespaceSize

The size of the namespace information array.

Constructor Detail

DOMNamespaceContextback to summary
pack-priv DOMNamespaceContext()

Method Detail

declarePrefixback to summary
public boolean declarePrefix(String prefix, String uri)

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.declarePrefix.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.declarePrefix.

Declare a Namespace prefix.

This method declares a prefix in the current Namespace context; the prefix will remain in force until this context is popped, unless it is shadowed in a descendant context.

Note that to declare a default Namespace, use the empty string. The prefixes "xml" and "xmlns" can't be rebound.

Note that you must not declare a prefix after you've pushed and popped another Namespace.

declarePrefix0back to summary
private void declarePrefix0(String prefix, String uri)
fillNamespaceContextback to summary
private void fillNamespaceContext()
getAllPrefixesback to summary
public Enumeration<String> getAllPrefixes()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getAllPrefixes.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getAllPrefixes.

Return an enumeration of all prefixes whose declarations are active in the current context. This includes declarations from parent contexts that have not been overridden.

getDeclaredPrefixAtback to summary
public String getDeclaredPrefixAt(int index)

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getDeclaredPrefixAt.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getDeclaredPrefixAt.

Returns the prefix at the specified index in the current context.

getDeclaredPrefixCountback to summary
public int getDeclaredPrefixCount()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getDeclaredPrefixCount.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getDeclaredPrefixCount.

Return a count of locally declared prefixes, including the default prefix if bound.

getPrefixback to summary
public String getPrefix(String uri)

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getPrefix.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getPrefix.

Look up a namespace URI and get one of the mapped prefix.

This method looks up the namespace URI in the current context. If more than one prefix is currently mapped to the same URI, this method will make an arbitrary selection If no mapping is found, this methods will continue lookup in the parent context(s).

getURIback to summary
public String getURI(String prefix)

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.getURI.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.getURI.

Look up a prefix and get the currently-mapped Namespace URI.

This method looks up the prefix in the current context. If no mapping is found, this methods will continue lookup in the parent context(s). Use the empty string ("") for the default Namespace.

getURI0back to summary
private String getURI0(String prefix)
popContextback to summary
public void popContext()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.popContext.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.popContext.

Revert to the previous Namespace context.

The context should be popped at the end of each XML element. After popping the context, all Namespace prefix mappings that were previously in force are restored.

Users must not attempt to declare additional Namespace prefixes after popping a context, unless you push another context first.

pushContextback to summary
public void pushContext()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.pushContext.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.pushContext.

Start a new Namespace context.

A new context should be pushed at the beginning of each XML element: the new context will automatically inherit the declarations of its parent context, but it will also keep track of which declarations were made within this context.

resetback to summary
public void reset()

Implements com.sun.org.apache.xerces.internal.xni.NamespaceContext.reset.

Doc from com.sun.org.apache.xerces.internal.xni.NamespaceContext.reset.

Reset this Namespace support object for reuse.

It is necessary to invoke this method before reusing the Namespace support object for a new session.

Note that implementations of this method need to ensure that the declaration of the prefixes "xmlns" and "xml" are available.