Package org.htmlunit.xpath.operations
Class Operation
- java.lang.Object
-
- org.htmlunit.xpath.Expression
-
- org.htmlunit.xpath.operations.Operation
-
-
Field Summary
Fields Modifier and Type Field Description protected Expression
m_left
The left operand expression.protected Expression
m_right
The right operand expression.
-
Constructor Summary
Constructors Constructor Description Operation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
callVisitors(XPathVisitor visitor)
This will traverse the hierarchy, calling the visitor for each member.boolean
canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.boolean
deepEquals(Expression expr)
Compare this object with another object and see if they are equal, include the sub heararchy.XObject
execute(XPathContext xctxt)
Execute an expression in the XPath runtime context, and return the result of the expression.XObject
operate(XObject left, XObject right)
Apply the operation to two operands, and return the result.void
setLeftRight(Expression l, Expression r)
Set the left and right operand expressions for this operation.-
Methods inherited from class org.htmlunit.xpath.Expression
asIterator, asNode, assertion, bool, error, execute, execute, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, num
-
-
-
-
Field Detail
-
m_left
protected Expression m_left
The left operand expression.
-
m_right
protected Expression m_right
The right operand expression.
-
-
Method Detail
-
canTraverseOutsideSubtree
public boolean canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.- Overrides:
canTraverseOutsideSubtree
in classExpression
- Returns:
- true if traversal outside the context node's subtree can occur.
-
setLeftRight
public void setLeftRight(Expression l, Expression r)
Set the left and right operand expressions for this operation.- Parameters:
l
- The left expression operand.r
- The right expression operand.
-
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.- Specified by:
execute
in classExpression
- 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.
-
operate
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException
Apply the operation to two operands, and return the result.- Parameters:
left
- non-null reference to the evaluated left operand.right
- non-null reference to the evaluated right operand.- Returns:
- non-null reference to the XObject that represents the result of the operation.
- Throws:
javax.xml.transform.TransformerException
- in case of error
-
callVisitors
public void callVisitors(XPathVisitor visitor)
This will traverse the hierarchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called.- Parameters:
visitor
- The visitor whose appropriate method will be called.
-
deepEquals
public boolean deepEquals(Expression expr)
Compare this object with another object and see if they are equal, include the sub heararchy.- Specified by:
deepEquals
in classExpression
- Parameters:
expr
- Another expression object.- Returns:
- true if this objects class and the expr object's class are the same, and the data contained within both objects are considered equal.
-
-