public class XPathPathExpr extends XPathExpression
Modifier and Type | Field and Description |
---|---|
XPathFilterExpr |
filtExpr |
int |
init_context |
static int |
INIT_CONTEXT_EXPR |
static int |
INIT_CONTEXT_RELATIVE |
static int |
INIT_CONTEXT_ROOT |
XPathStep[] |
steps |
indent
Constructor and Description |
---|
XPathPathExpr() |
XPathPathExpr(int init_context,
XPathStep[] steps) |
XPathPathExpr(XPathFilterExpr filtExpr,
XPathStep[] steps) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
XPathNodeset |
eval(FormInstance m,
EvaluationContext ec) |
static XPathPathExpr |
fromRef(TreeReference ref) |
TreeReference |
getReference() |
TreeReference |
getReference(boolean allowPredicates)
translate an xpath path reference into a TreeReference
TreeReferences only support a subset of true xpath paths; restrictions are:
simple child name tests 'child::name', '.', and '..' allowed only
no predicates
all '..' steps must come before anything else
|
static java.lang.Object |
getRefValue(FormInstance model,
EvaluationContext ec,
TreeReference ref) |
boolean |
matches(XPathExpression o)
Warning: this method has somewhat unclear semantics.
|
java.lang.Object |
pivot(FormInstance model,
EvaluationContext evalContext,
java.util.List<java.lang.Object> pivots,
java.lang.Object sentinal)
Pivot this expression, returning values if appropriate, and adding any pivots to the list.
|
void |
readExternal(java.io.DataInputStream in,
PrototypeFactory pf) |
java.lang.String |
toString() |
static java.lang.Object |
unpackValue(IAnswerData val) |
void |
writeExternal(java.io.DataOutputStream out) |
eval, hashCode, pivot, print, printParseTree
public static final int INIT_CONTEXT_ROOT
public static final int INIT_CONTEXT_RELATIVE
public static final int INIT_CONTEXT_EXPR
public int init_context
public XPathStep[] steps
public XPathFilterExpr filtExpr
public XPathPathExpr()
public XPathPathExpr(int init_context, XPathStep[] steps)
public XPathPathExpr(XPathFilterExpr filtExpr, XPathStep[] steps)
public TreeReference getReference() throws XPathUnsupportedException
XPathUnsupportedException
public TreeReference getReference(boolean allowPredicates) throws XPathUnsupportedException
XPathUnsupportedException
public XPathNodeset eval(FormInstance m, EvaluationContext ec)
eval
in class XPathExpression
public static java.lang.Object getRefValue(FormInstance model, EvaluationContext ec, TreeReference ref)
public static java.lang.Object unpackValue(IAnswerData val)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean matches(XPathExpression o)
o
- public void readExternal(java.io.DataInputStream in, PrototypeFactory pf) throws java.io.IOException, DeserializationException
java.io.IOException
DeserializationException
public void writeExternal(java.io.DataOutputStream out) throws java.io.IOException
java.io.IOException
public static XPathPathExpr fromRef(TreeReference ref)
public java.lang.Object pivot(FormInstance model, EvaluationContext evalContext, java.util.List<java.lang.Object> pivots, java.lang.Object sentinal) throws UnpivotableExpressionException
XPathExpression
pivot
in class XPathExpression
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.UnpivotableExpressionException
- If the expression is too complex to pivot