| Modifier and Type | Class and Description |
|---|---|
| private class | PathMatcher.SinglePathMatcher
the XPath matching engine. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | matchFound
a flag that indicates that this element/attribute matches the path expression. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | onAttribute(String namespaceURI, String localName, String value, Datatype type)
Overrides com. |
| protected abstract void | onAttributeMatched(String namespaceURI, String localName, String value, Datatype type)
this method is called when the attribute matches the XPath. |
| protected abstract void | onElementMatched(String namespaceURI, String localName)
this method is called when the element matches the XPath. |
| protected void | |
| protected void | startElement(String namespaceURI, String localName)
Overrides com. |
| matchFound | back to summary |
|---|---|
| private boolean matchFound a flag that indicates that this element/attribute matches the path expression. This flag is set by one of the child SinglePathMatcher. | |
| PathMatcher | back to summary |
|---|---|
| protected PathMatcher(IDConstraintChecker owner, XPath[] paths) | |
| onAttribute | back to summary |
|---|---|
| protected void onAttribute(String namespaceURI, String localName, String value, Datatype type) throws SAXException Overrides com. | |
| onAttributeMatched | back to summary |
|---|---|
| protected abstract void onAttributeMatched(String namespaceURI, String localName, String value, Datatype type) throws SAXException this method is called when the attribute matches the XPath. | |
| onElementMatched | back to summary |
|---|---|
| protected abstract void onElementMatched(String namespaceURI, String localName) throws SAXException this method is called when the element matches the XPath. | |
| start | back to summary |
|---|---|
| protected void start(String namespaceURI, String localName) throws SAXException this method should be called immediately after the installment of this PathMatcher. | |
| startElement | back to summary |
|---|---|
| protected void startElement(String namespaceURI, String localName) throws SAXException Overrides com. | |
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 final XPath |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | onAttribute(String namespaceURI, String localName, String value, Datatype type)
Implements abstract com. |
| protected void | startElement(String namespaceURI, String localName)
Implements abstract com. |
| activeSteps | back to summary |
|---|---|
| private boolean[][] activeSteps stores matched steps. first dimension is expanded as the depth goes deep. second dimension is always equal to the size of steps. | |
| elementMatched | back to summary |
|---|---|
| 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. When this flag is true, we need to honor the onAttribute event and check if the path really matches to the attribute. | |
| path | back to summary |
|---|---|
| protected final XPath path | |
| SinglePathMatcher | back to summary |
|---|---|
| protected SinglePathMatcher(XPath path) | |
| endElement | back to summary |
|---|---|
| protected void endElement(Datatype dt) Implements abstract com. | |
| onAttribute | back to summary |
|---|---|
| protected void onAttribute(String namespaceURI, String localName, String value, Datatype type) throws SAXException Implements abstract com. | |
| startElement | back to summary |
|---|---|
| protected void startElement(String namespaceURI, String localName) throws SAXException Implements abstract com. | |