org.exolab.adaptx.xpath.engine
Class FilterBase
java.lang.Object
org.exolab.adaptx.xpath.engine.FilterBase
- MatchExpression, PathComponent, XPathExpression
public abstract class FilterBase
extends java.lang.Object
The base class for filters (now basically called paths)
$Revision: 1.2 $ $Date: 2003/05/13 07:59:08 $
BOOLEAN , ERROR , FILTER_EXPR , LOCATION_PATH , NODE_TEST , NUMBER , PATH_EXPR , PRIMARY , STEP , STRING , UNION_EXPR |
FilterBase(int ancestryOp) - Creates a new FilterBase
|
void | addPredicate(XPathExpression expr) - Adds the given Expression to this FilterBase's predicate
List.
|
void | addPredicate(org.exolab.adaptx.xpath.engine.PredicateExprImpl predicate) - Adds the given Expression to this FilterBase's predicate
List.
|
abstract XPathResult | evaluate(XPathContext context) - Evaluates the expression and returns the XPath result.
|
void | evaluatePredicates(NodeSet nodes, XPathContext context) - Evaluates the PredicateExpr of this FilterBase against the given Node.
|
int | getAncestryOp()
|
abstract double | getDefaultPriority() - Determines the priority of a PatternExpr as follows:
From the 19991116 XSLT 1.0 Recommendation:
+ If the pattern has the form of a QName preceded by a
ChildOrAttributeAxisSpecifier or has the form
processing-instruction(Literal) then the priority is 0.
|
abstract short | getExprType() - Returns the type of this expression.
|
PredicateExpr | getPredicate() - Returns the PredicateExpr of this Filter
|
boolean | hasPredicates() - Returns true if this FilterBase has predicates expressions.
|
abstract boolean | matches(XPathNode node, XPathContext context) - Determines if the given node is matched by this MatchExpr with
respect to the given context.
|
String | toString() - Returns the String representation of this FilterBase
|
NO_OP
public static final int NO_OP
PARENT_OP
public static final int PARENT_OP
FilterBase
public FilterBase(int ancestryOp)
Creates a new FilterBase
addPredicate
public void addPredicate(XPathExpression expr)
throws XPathException
Adds the given Expression to this FilterBase's predicate
List.
expr
- the Expr to add to the predicate list
addPredicate
public void addPredicate(org.exolab.adaptx.xpath.engine.PredicateExprImpl predicate)
throws XPathException
Adds the given Expression to this FilterBase's predicate
List.
getAncestryOp
public int getAncestryOp()
getDefaultPriority
public abstract double getDefaultPriority()
Determines the priority of a PatternExpr as follows:
From the 19991116 XSLT 1.0 Recommendation:
+ If the pattern has the form of a QName preceded by a
ChildOrAttributeAxisSpecifier or has the form
processing-instruction(Literal) then the priority is 0.
+ If the pattern has the form NCName:* preceded by a
ChildOrAttributeAxisSpecifier, then the priority is -0.25
+ Otherwise if the pattern consists of just a NodeTest
preceded by a ChildOrAttributeAxisSpecifier then the
priority is -0.5
+ Otherwise the priority is 0.5
- getDefaultPriority in interface PathComponent
- the priority for this PatternExpr
getExprType
public abstract short getExprType()
Returns the type of this expression.
- getExprType in interface XPathExpression
- The type of this expression
hasPredicates
public boolean hasPredicates()
Returns true if this FilterBase has predicates expressions.
- hasPredicates in interface PathComponent
- true if this FilterBase has predicates expressions.
matches
public abstract boolean matches(XPathNode node,
XPathContext context)
throws XPathException
Determines if the given node is matched by this MatchExpr with
respect to the given context.
- matches in interface MatchExpression
node
- the node to determine a match forcontext
- the XPathContext
- true if the given node is matched by this MatchExpr
toString
public String toString()
Returns the String representation of this FilterBase
- toString in interface XPathExpression
- the String representation of this FilterBase