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 class
PathMatcher.SinglePathMatcher
the XPath matching engine.
-
Field Summary
Fields Modifier and Type Field Description private boolean
matchFound
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 Modifier Constructor Description protected
PathMatcher(IDConstraintChecker owner, XPath[] paths)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
onAttribute(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value, org.relaxng.datatype.Datatype type)
protected abstract void
onAttributeMatched(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 void
onElementMatched(java.lang.String namespaceURI, java.lang.String localName)
this method is called when the element matches the XPath.protected void
start(java.lang.String namespaceURI, java.lang.String localName)
this method should be called immediately after the installment of this PathMatcher.protected void
startElement(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.SAXException
this 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.SAXException
this 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.SAXException
this 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:
startElement
in 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:
onAttribute
in classMatcherBundle
- Throws:
org.xml.sax.SAXException
-
-