Package org.jaxen

Class JaxenHandler

  • All Implemented Interfaces:
    XPathHandler
    Direct Known Subclasses:
    PatternHandler

    public class JaxenHandler
    extends Object
    implements XPathHandler
    SAXPath XPathHandler implementation capable of building Jaxen expression trees which can walk various different object models.
    Author:
    bob mcwhirter (bob@werken.com)
    • Field Detail

      • simplified

        protected boolean simplified
        ????
      • stack

        protected LinkedList stack
        This may be changed to an ArrayList in the future (i.e. version >= 1.2). You really shouldn't be accessing this field directly, but if you are please try to use it as a generic List. Don't use the methods that are only available in LinkedList.
    • Constructor Detail

      • JaxenHandler

        public JaxenHandler()
        Constructor
    • Method Detail

      • setXPathFactory

        public void setXPathFactory​(XPathFactory xpathFactory)
        Set the Jaxen XPathFactory that constructs the XPath expression tree during the parse.
        Parameters:
        xpathFactory - the factory to use during the parse
      • getXPathFactory

        public XPathFactory getXPathFactory()
        Retrieve the Jaxen XPathFactory used during the parse to construct the XPath expression tree.
        Returns:
        the XPathFactory used during the parse.
      • getXPathExpr

        public XPathExpr getXPathExpr()
        Retrieve the simplified Jaxen XPath expression tree.

        This method is only valid once XPathReader.parse(...) successfully returned.

        Returns:
        the XPath expression tree
      • getXPathExpr

        public XPathExpr getXPathExpr​(boolean shouldSimplify)
        Retrieve the Jaxen XPath expression tree, optionally simplified.

        This method is only valid once XPathReader.parse(...) successfully returned.

        Parameters:
        shouldSimplify - ????
        Returns:
        the XPath expression tree
      • startXPath

        public void startXPath()
        Description copied from interface: XPathHandler
        Receive notification of the start of an XPath expression parse.
        Specified by:
        startXPath in interface XPathHandler
      • startPathExpr

        public void startPathExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of a path expression.
        Specified by:
        startPathExpr in interface XPathHandler
      • startNameStep

        public void startNameStep​(int axis,
                                  String prefix,
                                  String localName)
                           throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the start of a name step.
        Specified by:
        startNameStep in interface XPathHandler
        Parameters:
        axis - the axis of this step
        prefix - the namespace prefix for the name to test, or the empty string if no prefix is specified
        localName - the local part of the name to test
        Throws:
        JaxenException
      • endNameStep

        public void endNameStep()
        Description copied from interface: XPathHandler
        Receive notification of the end of a NameStep
        Specified by:
        endNameStep in interface XPathHandler
      • endTextNodeStep

        public void endTextNodeStep()
        Description copied from interface: XPathHandler
        Receive notification of the end of a text() step.
        Specified by:
        endTextNodeStep in interface XPathHandler
      • endCommentNodeStep

        public void endCommentNodeStep()
        Description copied from interface: XPathHandler
        Receive notification of the end of a comment() step.
        Specified by:
        endCommentNodeStep in interface XPathHandler
      • endAllNodeStep

        public void endAllNodeStep()
        Description copied from interface: XPathHandler
        Receive notification of the end of a node() step.
        Specified by:
        endAllNodeStep in interface XPathHandler
      • startProcessingInstructionNodeStep

        public void startProcessingInstructionNodeStep​(int axis,
                                                       String name)
                                                throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the start of a processing-instruction(...) step.
        Specified by:
        startProcessingInstructionNodeStep in interface XPathHandler
        Parameters:
        axis - the axis of this step
        name - the name of the processing-instruction, or the empty string if none is specified
        Throws:
        JaxenException
      • endStep

        protected void endStep()
      • startPredicate

        public void startPredicate()
        Description copied from interface: XPathHandler
        Receive notification of the start of a predicate.
        Specified by:
        startPredicate in interface XPathHandler
      • startFilterExpr

        public void startFilterExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of a filter expression.
        Specified by:
        startFilterExpr in interface XPathHandler
      • returnExpr

        protected void returnExpr()
      • startOrExpr

        public void startOrExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of an 'or' expression.
        Specified by:
        startOrExpr in interface XPathHandler
      • endOrExpr

        public void endOrExpr​(boolean create)
                       throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the end of an 'or' expression.
        Specified by:
        endOrExpr in interface XPathHandler
        Parameters:
        create - flag that indicates if this expression should truly be instantiated, or if it was just a pass-through, based upon the grammar productions
        Throws:
        JaxenException
      • startAndExpr

        public void startAndExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of an 'and' expression.
        Specified by:
        startAndExpr in interface XPathHandler
      • endAndExpr

        public void endAndExpr​(boolean create)
                        throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the end of an 'and' expression.
        Specified by:
        endAndExpr in interface XPathHandler
        Parameters:
        create - flag that indicates if this expression should truly be instantiated, or if it was just a pass-through, based upon the grammar productions
        Throws:
        JaxenException
      • startEqualityExpr

        public void startEqualityExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of an equality ('=' or '!=') expression.
        Specified by:
        startEqualityExpr in interface XPathHandler
      • endEqualityExpr

        public void endEqualityExpr​(int operator)
                             throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the end of an equality ('=' or '!=') expression.
        Specified by:
        endEqualityExpr in interface XPathHandler
        Parameters:
        operator - the operator specific to this particular equality expression. If null, this expression is only a pass-through, and should not actually be instantiated.
        Throws:
        JaxenException
      • startRelationalExpr

        public void startRelationalExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.
        Specified by:
        startRelationalExpr in interface XPathHandler
      • endRelationalExpr

        public void endRelationalExpr​(int operator)
                               throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the start of a relational ('<', '>', '<=', or '>=') expression.
        Specified by:
        endRelationalExpr in interface XPathHandler
        Parameters:
        operator - the operator specific to this particular relational expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated.
        Throws:
        JaxenException
      • startAdditiveExpr

        public void startAdditiveExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of an additive ('+' or '-') expression.
        Specified by:
        startAdditiveExpr in interface XPathHandler
      • endAdditiveExpr

        public void endAdditiveExpr​(int operator)
                             throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the end of an additive ('+' or '-') expression.
        Specified by:
        endAdditiveExpr in interface XPathHandler
        Parameters:
        operator - the operator specific to this particular additive expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated.
        Throws:
        JaxenException
      • startMultiplicativeExpr

        public void startMultiplicativeExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.
        Specified by:
        startMultiplicativeExpr in interface XPathHandler
      • endMultiplicativeExpr

        public void endMultiplicativeExpr​(int operator)
                                   throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the start of a multiplicative ('*', 'div' or 'mod') expression.
        Specified by:
        endMultiplicativeExpr in interface XPathHandler
        Parameters:
        operator - the operator specific to this particular multiplicative expression. If null, this expression is only a pass-through, and should not actually be instantiated.
        Throws:
        JaxenException
      • startUnaryExpr

        public void startUnaryExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of a unary ('+' or '-') expression.
        Specified by:
        startUnaryExpr in interface XPathHandler
      • endUnaryExpr

        public void endUnaryExpr​(int operator)
                          throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the end of a unary ('+' or '-') expression.
        Specified by:
        endUnaryExpr in interface XPathHandler
        Parameters:
        operator - the operator specific to this particular unary expression. If NO_OP, this expression is only a pass-through, and should not actually be instantiated. If not Operator.NO_OP, it will always be Operator.NEGATIVE.
        Throws:
        JaxenException
      • startUnionExpr

        public void startUnionExpr()
        Description copied from interface: XPathHandler
        Receive notification of the start of a union ('|') expression.
        Specified by:
        startUnionExpr in interface XPathHandler
      • endUnionExpr

        public void endUnionExpr​(boolean create)
                          throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of the end of a union ('|') expression.
        Specified by:
        endUnionExpr in interface XPathHandler
        Parameters:
        create - flag that indicates if this expression should truly be instantiated, or if it was just a pass-through, based upon the grammar productions
        Throws:
        JaxenException
      • variableReference

        public void variableReference​(String prefix,
                                      String variableName)
                               throws JaxenException
        Description copied from interface: XPathHandler
        Receive notification of a variable-reference expression.
        Specified by:
        variableReference in interface XPathHandler
        Parameters:
        prefix - the namespace prefix of the variable
        variableName - the local name of the variable
        Throws:
        JaxenException
      • endFunction

        public void endFunction()
        Description copied from interface: XPathHandler
        Receive notification of the end of a function call
        Specified by:
        endFunction in interface XPathHandler
      • stackSize

        protected int stackSize()
      • push

        protected void push​(Object obj)
      • pop

        protected Object pop()
      • canPop

        protected boolean canPop()
      • pushFrame

        protected void pushFrame()