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

public final Class XPointerHandler

extends XIncludeHandler
implements XPointerProcessor
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xpointer.XPointerProcessor
Imports
java.util.ArrayList, .HashMap, org.apache.xerces.impl.Constants, .XMLErrorReporter, org.apache.xerces.util.SymbolTable, .XMLChar, .XMLSymbols, org.apache.xerces.xinclude.XIncludeHandler, .XIncludeNamespaceSupport, org.apache.xerces.xni.Augmentations, .QName, .XMLAttributes, .XMLDocumentHandler, .XMLString, .XNIException, org.apache.xerces.xni.parser.XMLConfigurationException, .XMLErrorHandler

This is a pipeline component which extends the XIncludeHandler to perform XPointer specific processing specified in the W3C XPointerFramework and element() Scheme Recommendations.

This component analyzes each event in the pipeline, looking for an element that matches a PointerPart in the parent XInclude element's xpointer attribute value. If the match succeeds, all children are passed by this component.

See the XPointer Framework Recommendation for more information on the XPointer Framework and ShortHand Pointers. See the XPointer element() Scheme Recommendation for more information on the XPointer element() Scheme.

Version
$Id: XPointerHandler.java 603808 2007-12-13 03:44:48Z mrglavas $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
XPointerHandler.Scanner

The XPointer expression scanner.

private class
XPointerHandler.Tokens

List of XPointer Framework tokens.

Field Summary

Modifier and TypeField and Description
private final String
protected XMLErrorHandler
protected boolean
protected boolean
protected boolean
protected boolean
protected SymbolTable
protected XMLErrorReporter
protected XPointerPart
protected ArrayList<E>
Inherited from org.apache.xerces.xinclude.XIncludeHandler:
ALLOW_UE_AND_NOTATION_EVENTSBUFFER_SIZECURRENT_BASE_URIDYNAMIC_VALIDATIONENTITY_RESOLVERERROR_REPORTERfBaseURIfBaseURIScopefBufferSizefChildConfigfCurrentBaseURIfCurrentLanguagefDocLocationfDocumentHandlerfDocumentSourcefDTDHandlerfDTDSourcefEntityResolverfErrorReporterfExpandedSystemIDfHrefFromParentfLanguageScopefLanguageStackfLiteralSystemIDfNamespaceContextfParentRelativeURIfParentXIncludeHandlerfSecurityManagerfSettingsfXInclude10TextReaderfXInclude11TextReaderfXIncludeChildConfigfXIncludeLocatorfXIncludeMessageFormatterfXPointerChildConfigfXPtrProcessorHTTP_ACCEPTHTTP_ACCEPT_LANGUAGEJAXP_SCHEMA_LANGUAGEPARSER_SETTINGSSCHEMA_VALIDATIONSECURITY_MANAGERSYMBOL_TABLEVALIDATIONXINCLUDE_ATTR_ACCEPTXINCLUDE_ATTR_ACCEPT_LANGUAGEXINCLUDE_ATTR_ENCODINGXINCLUDE_ATTR_HREFXINCLUDE_ATTR_PARSEXINCLUDE_DEFAULT_CONFIGURATIONXINCLUDE_FALLBACKXINCLUDE_FIXUP_BASE_URISXINCLUDE_FIXUP_LANGUAGEXINCLUDE_INCLUDEXINCLUDE_INCLUDEDXINCLUDE_NS_URIXINCLUDE_PARSE_TEXTXINCLUDE_PARSE_XMLXPOINTER

Constructor Summary

AccessConstructor and Description
public
public
XPointerHandler(SymbolTable symbolTable, XMLErrorHandler errorHandler, XMLErrorReporter errorReporter)

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.xinclude.XIncludeHandler.characters.

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

Character content.
public void
comment(XMLString
The text in the comment.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.xinclude.XIncludeHandler.comment.

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

If the comment is a child of a matched element, then pass else return.
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.xinclude.XIncludeHandler.emptyElement.

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

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

Overrides org.apache.xerces.xinclude.XIncludeHandler.endCDATA.

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

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

Overrides org.apache.xerces.xinclude.XIncludeHandler.endElement.

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

The end of an element.
public ArrayList<E>

Returns:

An ArrayList of XPointerPart objects.
getPointerParts
()

Returns an ArrayList of XPointerPart objects

public XPointerPart

Returns:

String - The pointer part used to resolve the document fragment.
getXPointerPart
()

Returns the pointer part used to resolve the document fragment.

public void
ignorableWhitespace(XMLString
The ignorable whitespace.
text
,
Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.xinclude.XIncludeHandler.ignorableWhitespace.

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

Ignorable whitespace.
protected void
init()

Initializes the XPointer Processor;

protected void
initErrorReporter()

Initializes error handling objects

public boolean
isChildFragmentResolved()

Returns true if the XPointer expression resolves to a non-element child of the current resource fragment.

public boolean
isFragmentResolved()

Implements org.apache.xerces.xpointer.XPointerProcessor.isFragmentResolved.

Returns true if the Node fragment is resolved.
public boolean
isXPointerResolved()

Implements org.apache.xerces.xpointer.XPointerProcessor.isXPointerResolved.

Returns true if the XPointer successfully found a sub-resource .
public void
parseXPointer(String
A String representing the xpointer expression.
xpointer
)

Implements org.apache.xerces.xpointer.XPointerProcessor.parseXPointer.

Parses the XPointer framework expression and delegates scheme specific parsing.
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
)

Overrides org.apache.xerces.xinclude.XIncludeHandler.processingInstruction.

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

A processing instruction.
private void
reportError(String key, Object[] arguments)

Reports XPointer Errors

private void
reportWarning(String key, Object[] arguments)

Reports XPointer Warnings

public boolean
resolveXPointer(QName
- The name of the element.
element
,
XMLAttributes
- The element attributes.
attributes
,
Augmentations
- Additional information that may include infoset augmentations
augs
,
int
- An integer indicating 0 - The start of an element 1 - The end of an element 2 - An empty element call
event
)

Implements org.apache.xerces.xpointer.XPointerProcessor.resolveXPointer.

Evaluates an XML resource with respect to an XPointer expressions by checking if it's element and attributes parameters match the criteria specified in the xpointer expression.
public void
public void
setProperty(String
The property identifier.
propertyId
,
Object
The value of the property.
value
)

Overrides org.apache.xerces.xinclude.XIncludeHandler.setProperty.

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

Sets the value of a property.

public void
startCDATA(Augmentations
Additional information that may include infoset augmentations
augs
)

Overrides org.apache.xerces.xinclude.XIncludeHandler.startCDATA.

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

The start of a CDATA section.
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.xinclude.XIncludeHandler.startElement.

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

The start of an element.
Inherited from org.apache.xerces.xinclude.XIncludeHandler:
addNotationaddUnparsedEntityattributeDeclcheckAndSendNotationcheckAndSendUnparsedEntitycheckNotationcheckUnparsedEntitycopyFeaturescopyFeaturesdoctypeDeclelementDeclendAttlistendConditionalendDocumentendDTDendExternalSubsetendGeneralEntityendParameterEntityexternalEntityDeclgetBaseURIgetDocumentHandlergetDocumentSourcegetDTDHandlergetDTDSourcegetFeatureDefaultgetLanguagegetPropertyDefaultgetRecognizedFeaturesgetRecognizedPropertiesgetRelativeBaseURIgetRelativeURIgetSawFallbackgetSawIncludegetStategetStatehandleFallbackElementhandleIncludeElementhasXIncludeNamespaceignoredCharactersinternalEntityDeclisFallbackElementisIncludeElementisRootDocumentisTopLevelIncludedItemisTopLevelIncludedItemViaFallbackisTopLevelIncludedItemViaIncludemodifyAugmentationsmodifyAugmentationsnotationDeclprocessAttributesprocessXMLBaseAttributesprocessXMLLangAttributesreportFatalErrorreportFatalErrorreportFatalErrorreportResourceErrorreportResourceErrorreportResourceErrorresetrestoreBaseURIrestoreLanguagesameBaseURIAsIncludeParentsameLanguageAsIncludeParentsaveBaseURIsaveLanguagesearchForRecursiveIncludessetDocumentSourcesetDTDHandlersetDTDSourcesetFeaturesetHrefsetParentsetSawFallbacksetSawIncludesetStatesetupCurrentBaseURIsetXIncludeLocatorstartAttliststartConditionalstartDocumentstartDTDstartExternalSubsetstartGeneralEntitystartParameterEntitytextDeclunparsedEntityDeclxmlDecl