org.apache.xpath.patterns
Class FunctionPattern

java.lang.Object
  extended by org.apache.xpath.Expression
      extended by org.apache.xpath.patterns.NodeTest
          extended by org.apache.xpath.patterns.StepPattern
              extended by org.apache.xpath.patterns.FunctionPattern
All Implemented Interfaces:
java.io.Serializable, javax.xml.transform.SourceLocator, SubContextList, ExpressionNode, ExpressionOwner, XPathVisitable

public class FunctionPattern
extends StepPattern

Match pattern step that contains a function.

See Also:
Serialized Form

Nested Class Summary
(package private)  class FunctionPattern.FunctionOwner
           
 
Nested classes/interfaces inherited from class org.apache.xpath.patterns.StepPattern
StepPattern.PredOwner
 
Field Summary
(package private)  Expression m_functionExpr
          Should be a expression.
(package private) static long serialVersionUID
           
 
Fields inherited from class org.apache.xpath.patterns.StepPattern
m_axis, m_predicates, m_relativePathPattern, m_targetString
 
Fields inherited from class org.apache.xpath.patterns.NodeTest
m_name, m_namespace, m_score, m_whatToShow, SCORE_NODETEST, SCORE_NONE, SCORE_NSWILD, SCORE_OTHER, SCORE_QNAME, SHOW_BYFUNCTION, SUPPORTS_PRE_STRIPPING, WILD
 
Constructor Summary
FunctionPattern(Expression expr, int axis, int predaxis)
          Construct a FunctionPattern from a expression.
 
Method Summary
 void calcScore()
          Static calc of match score.
protected  void callSubtreeVisitors(XPathVisitor visitor)
          Call the visitor for the function.
 XObject execute(XPathContext xctxt)
          Test a node to see if it matches the given node test.
 XObject execute(XPathContext xctxt, int context)
          Test a node to see if it matches the given node test.
 XObject execute(XPathContext xctxt, int context, DTM dtm, int expType)
          Test a node to see if it matches the given node test.
 void fixupVariables(java.util.Vector vars, int globalsSize)
          This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.
 
Methods inherited from class org.apache.xpath.patterns.StepPattern
calcTargetString, callVisitors, canTraverseOutsideSubtree, deepEquals, executePredicates, executeRelativePathPattern, getAxis, getExpression, getLastPos, getMatchScore, getPredicate, getPredicateCount, getPredicates, getProximityPosition, getRelativePathPattern, getTargetString, setAxis, setExpression, setPredicates, setRelativePathPattern, toString
 
Methods inherited from class org.apache.xpath.patterns.NodeTest
debugWhatToShow, getDefaultScore, getLocalName, getNamespace, getNodeTypeTest, getStaticScore, getWhatToShow, initNodeTest, initNodeTest, setLocalName, setNamespace, setStaticScore, setWhatToShow
 
Methods inherited from class org.apache.xpath.Expression
asIterator, asIteratorRaw, asNode, assertion, bool, error, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isSameClass, isStableNumber, num, warn, xstr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

m_functionExpr

Expression m_functionExpr
Should be a expression.

Constructor Detail

FunctionPattern

public FunctionPattern(Expression expr,
                       int axis,
                       int predaxis)
Construct a FunctionPattern from a expression. NEEDSDOC @param expr

Method Detail

calcScore

public final void calcScore()
Static calc of match score.

Overrides:
calcScore in class StepPattern

fixupVariables

public void fixupVariables(java.util.Vector vars,
                           int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

Overrides:
fixupVariables in class StepPattern
Parameters:
vars - List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).
globalsSize - The number of variables in the global variable area.

execute

public XObject execute(XPathContext xctxt,
                       int context)
                throws javax.xml.transform.TransformerException
Test a node to see if it matches the given node test.

Overrides:
execute in class StepPattern
Parameters:
xctxt - XPath runtime context.
context - The current node context.
Returns:
NodeTest.SCORE_NODETEST, NodeTest.SCORE_NONE, NodeTest.SCORE_NSWILD, NodeTest.SCORE_QNAME, or NodeTest.SCORE_OTHER.
Throws:
javax.xml.transform.TransformerException

execute

public XObject execute(XPathContext xctxt,
                       int context,
                       DTM dtm,
                       int expType)
                throws javax.xml.transform.TransformerException
Test a node to see if it matches the given node test.

Overrides:
execute in class StepPattern
Parameters:
xctxt - XPath runtime context.
context - The currentNode.
dtm - The DTM of the current node.
expType - The expanded type ID of the current node.
Returns:
NodeTest.SCORE_NODETEST, NodeTest.SCORE_NONE, NodeTest.SCORE_NSWILD, NodeTest.SCORE_QNAME, or NodeTest.SCORE_OTHER.
Throws:
javax.xml.transform.TransformerException

execute

public XObject execute(XPathContext xctxt)
                throws javax.xml.transform.TransformerException
Test a node to see if it matches the given node test.

Overrides:
execute in class StepPattern
Parameters:
xctxt - XPath runtime context.
Returns:
NodeTest.SCORE_NODETEST, NodeTest.SCORE_NONE, NodeTest.SCORE_NSWILD, NodeTest.SCORE_QNAME, or NodeTest.SCORE_OTHER.
Throws:
javax.xml.transform.TransformerException

callSubtreeVisitors

protected void callSubtreeVisitors(XPathVisitor visitor)
Call the visitor for the function.

Overrides:
callSubtreeVisitors in class StepPattern