public final class XPointerHandler extends XIncludeHandler implements XPointerProcessor
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.
XIncludeHandler.Notation, XIncludeHandler.UnparsedEntity
Modifier and Type | Field and Description |
---|---|
protected org.apache.xerces.xni.parser.XMLErrorHandler |
fErrorHandler |
protected boolean |
fFixupBase |
protected boolean |
fFixupLang |
protected boolean |
fFoundMatchingPtrPart |
protected boolean |
fIsXPointerResolved |
protected SymbolTable |
fSymbolTable |
protected XMLErrorReporter |
fXPointerErrorReporter |
protected XPointerPart |
fXPointerPart |
protected java.util.ArrayList |
fXPointerParts |
ALLOW_UE_AND_NOTATION_EVENTS, BUFFER_SIZE, CURRENT_BASE_URI, DYNAMIC_VALIDATION, ENTITY_RESOLVER, ERROR_REPORTER, fBaseURI, fBaseURIScope, fBufferSize, fChildConfig, fCurrentBaseURI, fCurrentLanguage, fDocLocation, fDocumentHandler, fDocumentSource, fDTDHandler, fDTDSource, fEntityResolver, fErrorReporter, fExpandedSystemID, fHrefFromParent, fLanguageScope, fLanguageStack, fLiteralSystemID, fNamespaceContext, fParentRelativeURI, fParentXIncludeHandler, fSecurityManager, fSettings, fXInclude10TextReader, fXInclude11TextReader, fXIncludeChildConfig, fXIncludeLocator, fXIncludeMessageFormatter, fXPointerChildConfig, fXPtrProcessor, HTTP_ACCEPT, HTTP_ACCEPT_LANGUAGE, JAXP_SCHEMA_LANGUAGE, PARSER_SETTINGS, SCHEMA_VALIDATION, SECURITY_MANAGER, SYMBOL_TABLE, VALIDATION, XINCLUDE_ATTR_ACCEPT, XINCLUDE_ATTR_ACCEPT_LANGUAGE, XINCLUDE_ATTR_ENCODING, XINCLUDE_ATTR_HREF, XINCLUDE_ATTR_PARSE, XINCLUDE_DEFAULT_CONFIGURATION, XINCLUDE_FALLBACK, XINCLUDE_FIXUP_BASE_URIS, XINCLUDE_FIXUP_LANGUAGE, XINCLUDE_INCLUDE, XINCLUDE_INCLUDED, XINCLUDE_NS_URI, XINCLUDE_PARSE_TEXT, XINCLUDE_PARSE_XML, XPOINTER
EVENT_ELEMENT_EMPTY, EVENT_ELEMENT_END, EVENT_ELEMENT_START
Constructor and Description |
---|
XPointerHandler() |
XPointerHandler(SymbolTable symbolTable,
org.apache.xerces.xni.parser.XMLErrorHandler errorHandler,
XMLErrorReporter errorReporter) |
Modifier and Type | Method and Description |
---|---|
void |
characters(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
Character content.
|
void |
comment(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
If the comment is a child of a matched element, then pass else return.
|
void |
emptyElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs)
An empty element.
|
void |
endCDATA(org.apache.xerces.xni.Augmentations augs)
The end of a CDATA section.
|
void |
endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
The end of an element.
|
java.util.ArrayList |
getPointerParts()
Returns an ArrayList of XPointerPart objects
|
XPointerPart |
getXPointerPart()
Returns the pointer part used to resolve the document fragment.
|
void |
ignorableWhitespace(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
Ignorable whitespace.
|
protected void |
init()
Initializes the XPointer Processor;
|
protected void |
initErrorReporter()
Initializes error handling objects
|
boolean |
isChildFragmentResolved()
Returns true if the XPointer expression resolves to a non-element child
of the current resource fragment.
|
boolean |
isFragmentResolved()
Returns true if the Node fragment is resolved.
|
boolean |
isXPointerResolved()
Returns true if the XPointer successfully found a sub-resource .
|
void |
parseXPointer(java.lang.String xpointer)
Parses the XPointer framework expression and delegates scheme specific parsing.
|
void |
processingInstruction(java.lang.String target,
org.apache.xerces.xni.XMLString data,
org.apache.xerces.xni.Augmentations augs)
A processing instruction.
|
boolean |
resolveXPointer(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs,
int event)
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.
|
void |
setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
Sets the document handler.
|
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
Sets the value of a property.
|
void |
startCDATA(org.apache.xerces.xni.Augmentations augs)
The start of a CDATA section.
|
void |
startElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs)
The start of an element.
|
addNotation, addUnparsedEntity, attributeDecl, checkAndSendNotation, checkAndSendUnparsedEntity, checkNotation, checkUnparsedEntity, copyFeatures, copyFeatures, doctypeDecl, elementDecl, endAttlist, endConditional, endDocument, endDTD, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getBaseURI, getDocumentHandler, getDocumentSource, getDTDHandler, getDTDSource, getFeatureDefault, getLanguage, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, getRelativeBaseURI, getRelativeURI, getSawFallback, getSawInclude, getState, getState, handleFallbackElement, handleIncludeElement, hasXIncludeNamespace, ignoredCharacters, internalEntityDecl, isFallbackElement, isIncludeElement, isRootDocument, isTopLevelIncludedItem, isTopLevelIncludedItemViaFallback, isTopLevelIncludedItemViaInclude, modifyAugmentations, modifyAugmentations, notationDecl, processAttributes, processXMLBaseAttributes, processXMLLangAttributes, reportFatalError, reportFatalError, reportFatalError, reportResourceError, reportResourceError, reportResourceError, reset, restoreBaseURI, restoreLanguage, sameBaseURIAsIncludeParent, sameLanguageAsIncludeParent, saveBaseURI, saveLanguage, searchForRecursiveIncludes, setDocumentSource, setDTDHandler, setDTDSource, setFeature, setHref, setParent, setSawFallback, setSawInclude, setState, setupCurrentBaseURI, setXIncludeLocator, startAttlist, startConditional, startDocument, startDTD, startExternalSubset, startGeneralEntity, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl
protected java.util.ArrayList fXPointerParts
protected XPointerPart fXPointerPart
protected boolean fFoundMatchingPtrPart
protected XMLErrorReporter fXPointerErrorReporter
protected org.apache.xerces.xni.parser.XMLErrorHandler fErrorHandler
protected SymbolTable fSymbolTable
protected boolean fIsXPointerResolved
protected boolean fFixupBase
protected boolean fFixupLang
public XPointerHandler()
public XPointerHandler(SymbolTable symbolTable, org.apache.xerces.xni.parser.XMLErrorHandler errorHandler, XMLErrorReporter errorReporter)
public void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
org.apache.xerces.xni.parser.XMLDocumentSource
setDocumentHandler
in interface org.apache.xerces.xni.parser.XMLDocumentSource
setDocumentHandler
in class XIncludeHandler
public void parseXPointer(java.lang.String xpointer) throws org.apache.xerces.xni.XNIException
parseXPointer
in interface XPointerProcessor
xpointer
- A String representing the xpointer expression.org.apache.xerces.xni.XNIException
- Thrown if the xpointer string does not conform to
the XPointer Framework syntax or the syntax of the pointer part does
not conform to its definition for its scheme.XPointerProcessor.parseXPointer(java.lang.String)
public boolean resolveXPointer(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs, int event) throws org.apache.xerces.xni.XNIException
XPointerProcessor
resolveXPointer
in interface XPointerProcessor
element
- - The name of the element.attributes
- - The element attributes.augs
- - Additional information that may include infoset augmentationsevent
- - An integer indicating
0 - The start of an element
1 - The end of an element
2 - An empty element callorg.apache.xerces.xni.XNIException
- Thrown to signal an errorXPointerProcessor.resolveXPointer(org.apache.xerces.xni.QName, org.apache.xerces.xni.XMLAttributes, org.apache.xerces.xni.Augmentations, int event)
public boolean isFragmentResolved() throws org.apache.xerces.xni.XNIException
isFragmentResolved
in interface XPointerProcessor
org.apache.xerces.xni.XNIException
- Thrown to signal an errorXPointerProcessor.isFragmentResolved()
public boolean isChildFragmentResolved() throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XNIException
XPointerPart.isChildFragmentResolved()
public boolean isXPointerResolved() throws org.apache.xerces.xni.XNIException
isXPointerResolved
in interface XPointerProcessor
org.apache.xerces.xni.XNIException
- Thrown to signal an errorXPointerProcessor.isFragmentResolved()
public XPointerPart getXPointerPart()
protected void initErrorReporter()
protected void init()
public java.util.ArrayList getPointerParts()
public void comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
comment
in interface org.apache.xerces.xni.XMLDocumentHandler
comment
in interface org.apache.xerces.xni.XMLDTDHandler
comment
in class XIncludeHandler
text
- The text in the comment.augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by application to signal an error.public void processingInstruction(java.lang.String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
Typically, a processing instruction's data will contain a series of pseudo-attributes. These pseudo-attributes follow the form of element attributes but are not parsed or presented to the application as anything other than text. The application is responsible for parsing the data.
processingInstruction
in interface org.apache.xerces.xni.XMLDocumentHandler
processingInstruction
in interface org.apache.xerces.xni.XMLDTDHandler
processingInstruction
in class XIncludeHandler
target
- The target.data
- The data or null if none specified.augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
startElement
in interface org.apache.xerces.xni.XMLDocumentHandler
startElement
in class XIncludeHandler
element
- The name of the element.attributes
- The element attributes.augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void emptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
emptyElement
in interface org.apache.xerces.xni.XMLDocumentHandler
emptyElement
in class XIncludeHandler
element
- The name of the element.attributes
- The element attributes.augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
characters
in interface org.apache.xerces.xni.XMLDocumentHandler
characters
in class XIncludeHandler
text
- The content.augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void ignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
ignorableWhitespace
in interface org.apache.xerces.xni.XMLDocumentHandler
ignorableWhitespace
in class XIncludeHandler
text
- The ignorable whitespace.augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
endElement
in interface org.apache.xerces.xni.XMLDocumentHandler
endElement
in class XIncludeHandler
element
- The name of the element.augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void startCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
startCDATA
in interface org.apache.xerces.xni.XMLDocumentHandler
startCDATA
in class XIncludeHandler
augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void endCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
endCDATA
in interface org.apache.xerces.xni.XMLDocumentHandler
endCDATA
in class XIncludeHandler
augs
- Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.public void setProperty(java.lang.String propertyId, java.lang.Object value) throws org.apache.xerces.xni.parser.XMLConfigurationException
Sets the value of a property. This method is called by the component manager any time after reset when a property changes value.
Note: Components should silently ignore properties that do not affect the operation of the component.setProperty
in interface org.apache.xerces.xni.parser.XMLComponent
setProperty
in class XIncludeHandler
propertyId
- The property identifier.value
- The value of the property.org.apache.xerces.xni.parser.XMLConfigurationException
- Thrown for configuration error.
In general, components should
only throw this exception if
it is really
a critical error.Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.