Package com.sun.msv.verifier.identity
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 class
the XPath matching engine. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
a flag that indicates that this element/attribute matches the path expression.Fields inherited from class com.sun.msv.verifier.identity.MatcherBundle
children
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
onAttribute
(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) protected abstract void
onAttributeMatched
(String namespaceURI, String localName, String value, org.relaxng.datatype.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
this method should be called immediately after the installment of this PathMatcher.protected void
startElement
(String namespaceURI, String localName) Methods inherited from class com.sun.msv.verifier.identity.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:
startElement
in classMatcherBundle
- Throws:
SAXException
-
onAttribute
protected void onAttribute(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) throws SAXException - Overrides:
onAttribute
in classMatcherBundle
- Throws:
SAXException
-