Class PathMatcher.SinglePathMatcher

  • Enclosing class:
    PathMatcher

    private class PathMatcher.SinglePathMatcher
    extends Matcher
    the XPath matching engine.

    This class implements the matching engine for single "Path".

    The outer PathMatcher uses multiple instances of this class and thereby implements the matching engine for the whole "Selector".

    This class 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.

    When a match is found, this class notifies the parent object by using a flag.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean[][] activeSteps
      stores matched steps.
      private boolean elementMatched
      this flag is set to true when the path contains an attribute step and the current element matches the element part of the path.
      protected XPath path  
      • Fields inherited from class com.sun.msv.verifier.identity.Matcher

        owner
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SinglePathMatcher​(XPath path)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void endElement​(org.relaxng.datatype.Datatype dt)  
      protected void onAttribute​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value, org.relaxng.datatype.Datatype type)  
      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

      • activeSteps

        private boolean[][] activeSteps
        stores matched steps. first dimension is expanded as the depth goes deep. second dimension is always equal to the size of steps.
      • path

        protected final XPath path
      • elementMatched

        private boolean elementMatched
        this flag is set to true when the path contains an attribute step and the current element matches the element part of the path. When this flag is true, we need to honor the onAttribute event and check if the path really matches to the attribute.
    • Constructor Detail

      • SinglePathMatcher

        protected SinglePathMatcher​(XPath path)
    • Method Detail

      • startElement

        protected void startElement​(java.lang.String namespaceURI,
                                    java.lang.String localName)
                             throws org.xml.sax.SAXException
        Specified by:
        startElement in class Matcher
        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
        Specified by:
        onAttribute in class Matcher
        Throws:
        org.xml.sax.SAXException
      • endElement

        protected void endElement​(org.relaxng.datatype.Datatype dt)
        Specified by:
        endElement in class Matcher