Package org.javarosa.xpath.expr
Class XPathExpression
java.lang.Object
org.javarosa.xpath.expr.XPathExpression
- All Implemented Interfaces:
Serializable,Externalizable
- Direct Known Subclasses:
XPathFilterExpr,XPathFuncExpr,XPathNumericLiteral,XPathOpExpr,XPathPathExpr,XPathStringLiteral,XPathVariableReference
public abstract class XPathExpression extends Object implements Externalizable, Serializable
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description XPathExpression() -
Method Summary
Modifier and Type Method Description Objecteval(EvaluationContext evalContext)abstract Objecteval(DataInstance model, EvaluationContext evalContext)inthashCode()List<Object>pivot(DataInstance model, EvaluationContext evalContext)Objectpivot(DataInstance model, EvaluationContext evalContext, List<Object> pivots, Object sentinal)Pivot this expression, returning values if appropriate, and adding any pivots to the list.voidprint(Object o)voidprintParseTree()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.javarosa.core.util.externalizable.Externalizable
readExternal, writeExternal
-
Constructor Details
-
XPathExpression
public XPathExpression()
-
-
Method Details
-
eval
-
eval
-
pivot
public final List<Object> pivot(DataInstance model, EvaluationContext evalContext) throws UnpivotableExpressionException- Throws:
UnpivotableExpressionException
-
pivot
public Object pivot(DataInstance model, EvaluationContext evalContext, List<Object> pivots, Object sentinal) throws UnpivotableExpressionExceptionPivot this expression, returning values if appropriate, and adding any pivots to the list.- Parameters:
model- The model to evaluate the current expression againstevalContext- The evaluation context to evaluate againstpivots- The list of pivot points in the xpath being evaluated. Pivots should be added to this list.sentinal- The value which is being pivoted around.- Returns:
- null - If a pivot was identified in this expression sentinal - If the current expression represents the sentinal being pivoted any other value - The result of the expression if no pivots are detected
- Throws:
UnpivotableExpressionException- If the expression is too complex to pivot
-
printParseTree
public void printParseTree() -
print
-
hashCode
public int hashCode()
-