Package com.sun.msv.verifier.identity
Class PathMatcher
java.lang.Object
com.sun.msv.verifier.identity.Matcher
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.
- Author:
- Kohsuke KAWAGUCHI
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
characters
(char[] buf, int start, int len) protected void
endElement
(org.relaxng.datatype.Datatype type) protected final int
getDepth()
protected 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
called when this bundle is deactivated.protected void
this method should be called immediately after the installment of this PathMatcher.protected void
startElement
(String namespaceURI, String localName)
-
Field Details
-
children
child matchers.
-
-
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
- Throws:
SAXException
-
onAttribute
protected void onAttribute(String namespaceURI, String localName, String value, org.relaxng.datatype.Datatype type) throws SAXException - Throws:
SAXException
-
getDepth
protected final int getDepth() -
endElement
- Specified by:
endElement
in classMatcher
- Throws:
SAXException
-
characters
- Overrides:
characters
in classMatcher
- Throws:
SAXException
-
onRemoved
called when this bundle is deactivated. This method is called by the endElement method when this bundle is removed. A derived class can override this method to do whatever necessary.- Throws:
SAXException
-