public class DefaultFilterExpr extends Object implements FilterExpr, Predicated
Constructor and Description |
---|
DefaultFilterExpr(Expr expr,
PredicateSet predicateSet) |
DefaultFilterExpr(PredicateSet predicateSet) |
Modifier and Type | Method and Description |
---|---|
void |
addPredicate(Predicate predicate)
Add an additional predicate to this object.
|
boolean |
asBoolean(Context context)
Returns true if the current filter matches at least one of the context nodes
|
static Iterator |
convertToIterator(Object obj) |
static List |
convertToList(Object obj) |
Object |
evaluate(Context context)
Evaluate the expression in the given context, and return the result.
|
Expr |
getExpr() |
List |
getPredicates()
Returns a possibly empty list of predicates.
|
PredicateSet |
getPredicateSet()
Returns a possibly empty set of predicates.
|
String |
getText()
Returns a String containing the XPath expression.
|
Expr |
simplify()
Simplifies the XPath expression.
|
String |
toString() |
public DefaultFilterExpr(PredicateSet predicateSet)
public DefaultFilterExpr(Expr expr, PredicateSet predicateSet)
public void addPredicate(Predicate predicate)
Predicated
addPredicate
in interface Predicated
predicate
- the predicate to addpublic List getPredicates()
Predicated
getPredicates
in interface Predicated
public PredicateSet getPredicateSet()
Predicated
getPredicateSet
in interface Predicated
public Expr getExpr()
getExpr
in interface FilterExpr
public String getText()
Expr
public Expr simplify()
Expr
//para[1 = 1]
could be simplified to
//para
. In practice, this is usually a noop.
Jaxen does not currently perform any simplification.public boolean asBoolean(Context context) throws JaxenException
asBoolean
in interface FilterExpr
JaxenException
public Object evaluate(Context context) throws JaxenException
Expr
java.lang.Double
for expressions that
return a number, a java.lang.String
for expressions that
return a string, a java.lang.Boolean
for expressions that
return a boolean, and a java.util.List
for expressions that
return a node-set. In the latter case, the elements of the list are
the actual objects from the source document model. Copies are not made.evaluate
in interface Expr
context
- the context in which the expression is evaluatedJaxenException
Copyright 2001–2022 The Jaxen Project. All rights reserved.