public class

XPathMatcher

extends Object
java.lang.Object
   ↳ org.apache.xerces.impl.xs.identity.XPathMatcher
Known Direct Subclasses

Class Overview

XPath matcher.

Summary

Constants
boolean DEBUG_ALL Compile to true to debug everything.
boolean DEBUG_ANY Don't touch this value unless you add more debug constants.
boolean DEBUG_MATCH Compile to true to debug match.
boolean DEBUG_METHODS Compile to true to debug method callbacks.
boolean DEBUG_METHODS2 Compile to true to debug important method callbacks.
boolean DEBUG_METHODS3 Compile to true to debug the really important methods.
boolean DEBUG_STACK Compile to true to debug step index stack.
int MATCHED
int MATCHED_ATTRIBUTE
int MATCHED_DESCENDANT
int MATCHED_DESCENDANT_PREVIOUS
Fields
protected Object fMatchedString The matching string.
Public Constructors
XPathMatcher(XPath xpath)
Constructs an XPath matcher that implements a document fragment handler.
Public Methods
void endElement(QName element, XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType)
boolean isMatched()
Returns value of first member of fMatched that is nonzero.
void startDocumentFragment()
The start of the document fragment.
void startElement(QName element, XMLAttributes attributes)
The start of an element.
String toString()
Returns a string representation of this object.
Protected Methods
void handleContent(XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType)
void matched(Object actualValue, short valueType, ShortList itemValueType, boolean isNil)
This method is called when the XPath handler matches the XPath expression.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

protected static final boolean DEBUG_ALL

Compile to true to debug everything.

Constant Value: false

protected static final boolean DEBUG_ANY

Don't touch this value unless you add more debug constants.

Constant Value: false

protected static final boolean DEBUG_MATCH

Compile to true to debug match.

Constant Value: false

protected static final boolean DEBUG_METHODS

Compile to true to debug method callbacks.

Constant Value: false

protected static final boolean DEBUG_METHODS2

Compile to true to debug important method callbacks.

Constant Value: false

protected static final boolean DEBUG_METHODS3

Compile to true to debug the really important methods.

Constant Value: false

protected static final boolean DEBUG_STACK

Compile to true to debug step index stack.

Constant Value: false

protected static final int MATCHED

Constant Value: 1 (0x00000001)

protected static final int MATCHED_ATTRIBUTE

Constant Value: 3 (0x00000003)

protected static final int MATCHED_DESCENDANT

Constant Value: 5 (0x00000005)

protected static final int MATCHED_DESCENDANT_PREVIOUS

Constant Value: 13 (0x0000000d)

Fields

protected Object fMatchedString

The matching string.

Public Constructors

public XPathMatcher (XPath xpath)

Constructs an XPath matcher that implements a document fragment handler.

Parameters
xpath The xpath.

Public Methods

public void endElement (QName element, XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType)

Parameters
element name of the element.
type content type of this element. IOW, the XML schema type of the value. Note that this may not be the type declared in the element declaration, but it is "the actual type". For example, if the XML is <foo xsi:type="xs:string">aaa</foo>, this parameter will be "xs:string".
nillable - nillable true if the element declaration is nillable.
value - actual value the typed value of the content of this element.

public boolean isMatched ()

Returns value of first member of fMatched that is nonzero.

public void startDocumentFragment ()

The start of the document fragment.

public void startElement (QName element, XMLAttributes attributes)

The start of an element. If the document specifies the start element by using an empty tag, then the startElement method will immediately be followed by the endElement method, with no intervening methods.

Parameters
element The name of the element.
attributes The element attributes.
Throws
SAXException Thrown by handler to signal an error.

public String toString ()

Returns a string representation of this object.

Protected Methods

protected void handleContent (XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType)

protected void matched (Object actualValue, short valueType, ShortList itemValueType, boolean isNil)

This method is called when the XPath handler matches the XPath expression. Subclasses can override this method to provide default handling upon a match.