Package com.sun.msv.verifier.identity
Class PathMatcher.SinglePathMatcher
java.lang.Object
com.sun.msv.verifier.identity.Matcher
com.sun.msv.verifier.identity.PathMatcher.SinglePathMatcher
- Enclosing class:
- PathMatcher
the XPath matching engine.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean[][]
stores matched steps.private boolean
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
endElement
(org.relaxng.datatype.Datatype dt) protected void
onAttribute
(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) protected void
startElement
(String namespaceURI, String localName) Methods inherited from class com.sun.msv.verifier.identity.Matcher
characters
-
Field Details
-
activeSteps
private boolean[][] activeStepsstores matched steps. first dimension is expanded as the depth goes deep. second dimension is always equal to the size of steps. -
path
-
elementMatched
private boolean elementMatchedthis 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.
-
-
Constructor Details
-
SinglePathMatcher
-
-
Method Details
-
startElement
- Specified by:
startElement
in classMatcher
- Throws:
SAXException
-
onAttribute
protected void onAttribute(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) throws SAXException - Specified by:
onAttribute
in classMatcher
- Throws:
SAXException
-
endElement
protected void endElement(org.relaxng.datatype.Datatype dt) - Specified by:
endElement
in classMatcher
-