Class 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.
    • 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.Matcher

        owner
    • 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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • matchFound

        private boolean matchFound
        a flag that indicates that this element/attribute matches the path expression. This flag is set by one of the child SinglePathMatcher.
    • 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 class MatcherBundle
        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 class MatcherBundle
        Throws:
        org.xml.sax.SAXException