Class PathMatcher
java.lang.Object
com.sun.msv.verifier.identity.Matcher
com.sun.msv.verifier.identity.MatcherBundle
com.sun.msv.verifier.identity.PathMatcher
- Direct Known Subclasses:
FieldMatcher, SelectorMatcher
Base implementation of XPath matching engine.
It 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.
Match to an attribute is not supported. It is implemented in FieldPathMatcher
class.
The onMatched method is called when the specified XPath matches the current element.
Derived classes should implement this method to do something useful.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classthe XPath matching engine. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleana flag that indicates that this element/attribute matches the path expression.Fields inherited from class MatcherBundle
children -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonAttribute(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) protected abstract voidonAttributeMatched(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) this method is called when the attribute matches the XPath.protected abstract voidonElementMatched(String namespaceURI, String localName) this method is called when the element matches the XPath.protected voidthis method should be called immediately after the installment of this PathMatcher.protected voidstartElement(String namespaceURI, String localName) Methods inherited from class MatcherBundle
characters, endElement, getDepth, onRemoved
-
Field Details
-
matchFound
private boolean matchFounda flag that indicates that this element/attribute matches the path expression. This flag is set by one of the child SinglePathMatcher.
-
-
Constructor Details
-
PathMatcher
-
-
Method Details
-
start
this method should be called immediately after the installment of this PathMatcher.- Throws:
SAXException
-
onElementMatched
this method is called when the element matches the XPath.- Throws:
SAXException
-
onAttributeMatched
protected abstract void onAttributeMatched(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) throws SAXException this method is called when the attribute matches the XPath.- Throws:
SAXException
-
startElement
- Overrides:
startElementin classMatcherBundle- Throws:
SAXException
-
onAttribute
protected void onAttribute(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) throws SAXException - Overrides:
onAttributein classMatcherBundle- Throws:
SAXException
-