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
public abstract class PathMatcher extends MatcherBundle
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 Classes Modifier and Type Class Description private classPathMatcher.SinglePathMatcherthe XPath matching engine.
-
Field Summary
Fields Modifier and Type Field Description private booleanmatchFounda 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 Modifier Constructor Description protectedPathMatcher(IDConstraintChecker owner, XPath[] paths)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidonAttribute(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value, org.relaxng.datatype.Datatype type)protected abstract voidonAttributeMatched(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value, org.relaxng.datatype.Datatype type)this method is called when the attribute matches the XPath.protected abstract voidonElementMatched(java.lang.String namespaceURI, java.lang.String localName)this method is called when the element matches the XPath.protected voidstart(java.lang.String namespaceURI, java.lang.String localName)this method should be called immediately after the installment of this PathMatcher.protected voidstartElement(java.lang.String namespaceURI, java.lang.String localName)-
Methods inherited from class com.sun.msv.verifier.identity.MatcherBundle
characters, endElement, getDepth, onRemoved
-
-
-
-
Constructor Detail
-
PathMatcher
protected PathMatcher(IDConstraintChecker owner, XPath[] paths)
-
-
Method Detail
-
start
protected void start(java.lang.String namespaceURI, java.lang.String localName) throws org.xml.sax.SAXExceptionthis method should be called immediately after the installment of this PathMatcher.- Throws:
org.xml.sax.SAXException
-
onElementMatched
protected abstract void onElementMatched(java.lang.String namespaceURI, java.lang.String localName) throws org.xml.sax.SAXExceptionthis method is called when the element matches the XPath.- Throws:
org.xml.sax.SAXException
-
onAttributeMatched
protected abstract void onAttributeMatched(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value, org.relaxng.datatype.Datatype type) throws org.xml.sax.SAXExceptionthis method is called when the attribute matches the XPath.- Throws:
org.xml.sax.SAXException
-
startElement
protected void startElement(java.lang.String namespaceURI, java.lang.String localName) throws org.xml.sax.SAXException- Overrides:
startElementin classMatcherBundle- Throws:
org.xml.sax.SAXException
-
onAttribute
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- Overrides:
onAttributein classMatcherBundle- Throws:
org.xml.sax.SAXException
-
-