Package org.htmlunit.xpath.patterns
Class FunctionPattern
- java.lang.Object
-
- org.htmlunit.xpath.Expression
-
- org.htmlunit.xpath.patterns.NodeTest
-
- org.htmlunit.xpath.patterns.StepPattern
-
- org.htmlunit.xpath.patterns.FunctionPattern
-
- All Implemented Interfaces:
javax.xml.transform.SourceLocator
,SubContextList
,ExpressionNode
,XPathVisitable
public class FunctionPattern extends StepPattern
Match pattern step that contains a function.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Expression
m_functionExpr
Should be aexpression
.-
Fields inherited from class org.htmlunit.xpath.patterns.StepPattern
m_axis, m_predicates, m_relativePathPattern, m_targetString
-
Fields inherited from class org.htmlunit.xpath.patterns.NodeTest
m_name, m_namespace, m_score, m_whatToShow, SCORE_NODETEST, SCORE_NONE, SCORE_NSWILD, SCORE_OTHER, SCORE_QNAME, SHOW_BYFUNCTION, WILD
-
-
Constructor Summary
Constructors Constructor Description FunctionPattern(Expression expr, int axis)
Construct a FunctionPattern from aexpression
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calcScore()
Static calc of match score.protected void
callSubtreeVisitors(XPathVisitor visitor)
Call the visitors on the subtree.XObject
execute(XPathContext xctxt)
Execute an expression in the XPath runtime context, and return the result of the expression.XObject
execute(XPathContext xctxt, int context)
Execute an expression in the XPath runtime context, and return the result of the expression.XObject
execute(XPathContext xctxt, int context, DTM dtm, int expType)
Execute an expression in the XPath runtime context, and return the result of the expression.-
Methods inherited from class org.htmlunit.xpath.patterns.StepPattern
calcTargetString, callVisitors, canTraverseOutsideSubtree, deepEquals, executePredicates, executeRelativePathPattern, getAxis, getLastPos, getPredicate, getPredicateCount, getPredicates, getProximityPosition, getRelativePathPattern, setAxis, setPredicates, setRelativePathPattern, toString
-
Methods inherited from class org.htmlunit.xpath.patterns.NodeTest
getLocalName, getNamespace, getNodeTypeTest, getStaticScore, getWhatToShow, initNodeTest, initNodeTest, setLocalName, setNamespace, setStaticScore, setWhatToShow
-
Methods inherited from class org.htmlunit.xpath.Expression
asIterator, asNode, assertion, bool, error, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, num
-
-
-
-
Field Detail
-
m_functionExpr
final Expression m_functionExpr
Should be aexpression
.
-
-
Constructor Detail
-
FunctionPattern
public FunctionPattern(Expression expr, int axis)
Construct a FunctionPattern from aexpression
.NEEDSDOC @param expr
-
-
Method Detail
-
calcScore
public final void calcScore()
Static calc of match score.- Overrides:
calcScore
in classStepPattern
-
execute
public XObject execute(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException
Execute an expression in the XPath runtime context, and return the result of the expression.- Overrides:
execute
in classStepPattern
- Parameters:
xctxt
- The XPath runtime context.context
- The currentNode.- Returns:
- The result of the expression in the form of a
XObject
. - Throws:
javax.xml.transform.TransformerException
- if a runtime exception occurs.
-
execute
public XObject execute(XPathContext xctxt, int context, DTM dtm, int expType) throws javax.xml.transform.TransformerException
Execute an expression in the XPath runtime context, and return the result of the expression.- Overrides:
execute
in classStepPattern
- Parameters:
xctxt
- The XPath runtime context.context
- The currentNode.dtm
- The DTM of the current node.expType
- The expanded type ID of the current node.- Returns:
- The result of the expression in the form of a
XObject
. - Throws:
javax.xml.transform.TransformerException
- if a runtime exception occurs.
-
execute
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
Execute an expression in the XPath runtime context, and return the result of the expression.- Overrides:
execute
in classStepPattern
- Parameters:
xctxt
- The XPath runtime context.- Returns:
- The result of the expression in the form of a
XObject
. - Throws:
javax.xml.transform.TransformerException
- if a runtime exception occurs.
-
callSubtreeVisitors
protected void callSubtreeVisitors(XPathVisitor visitor)
Call the visitors on the subtree. Factored out from callVisitors so it may be called by derived classes.- Overrides:
callSubtreeVisitors
in classStepPattern
-
-