Class FuncPosition
java.lang.Object
org.htmlunit.xpath.Expression
org.htmlunit.xpath.functions.Function
org.htmlunit.xpath.functions.FuncPosition
- All Implemented Interfaces:
SourceLocator, ExpressionNode, XPathVisitable
Execute the Position() function.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(XPathContext xctxt) Execute an expression in the XPath runtime context, and return the result of the expression.intGet the position in the current context node list.voidpostCompileStep(Compiler compiler) This function is currently only being used by Position() and Last().Methods inherited from class Function
callArgVisitors, callVisitors, checkNumberArgs, deepEquals, reportWrongNumberArgs, setArgMethods inherited from class Expression
asIterator, asNode, assertion, bool, canTraverseOutsideSubtree, error, execute, execute, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, num
-
Field Details
-
m_isTopLevel
private boolean m_isTopLevel
-
-
Constructor Details
-
FuncPosition
public FuncPosition()
-
-
Method Details
-
postCompileStep
This function is currently only being used by Position() and Last(). See respective functions for more detail.- Overrides:
postCompileStepin classFunction
-
getPositionInContextNodeList
Get the position in the current context node list.- Parameters:
xctxt- Runtime XPath context.- Returns:
- The current position of the iteration in the context node list, or -1 if there is no active context node list.
-
execute
Execute an expression in the XPath runtime context, and return the result of the expression.- Overrides:
executein classFunction- Parameters:
xctxt- The XPath runtime context.- Returns:
- The result of the expression in the form of a
XObject. - Throws:
TransformerException- if a runtime exception occurs.
-