private class PathMatcher.SinglePathMatcher extends Matcher
This class implements the matching engine for single "Path".
The outer PathMatcher
uses multiple instances of this class
and thereby implements the matching engine for the whole "Selector".
This class only supports the subset defined in XML Schema Part 1. Extra care must be taken to call the testInitialMatch method after the creation of an object.
When a match is found, this class notifies the parent object by using a flag.
Modifier and Type | Field and Description |
---|---|
private boolean[][] |
activeSteps
stores matched steps.
|
private boolean |
elementMatched
this flag is set to true when the path contains an attribute step
and the current element matches the element part of the path.
|
protected XPath |
path |
Modifier | Constructor and Description |
---|---|
protected |
SinglePathMatcher(XPath path) |
Modifier and Type | Method and Description |
---|---|
protected void |
endElement(org.relaxng.datatype.Datatype dt) |
protected void |
onAttribute(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String value,
org.relaxng.datatype.Datatype type) |
protected void |
startElement(java.lang.String namespaceURI,
java.lang.String localName) |
characters
private boolean[][] activeSteps
protected final XPath path
private boolean elementMatched
protected SinglePathMatcher(XPath path)
protected void startElement(java.lang.String namespaceURI, java.lang.String localName) throws org.xml.sax.SAXException
startElement
in class Matcher
org.xml.sax.SAXException
protected void onAttribute(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value, org.relaxng.datatype.Datatype type) throws org.xml.sax.SAXException
onAttribute
in class Matcher
org.xml.sax.SAXException
protected void endElement(org.relaxng.datatype.Datatype dt)
endElement
in class Matcher