org.exolab.adaptx.xpath.engine
public abstract class AbstractPathComponent extends Object implements PathComponent
Version: $Revision: 4055 $ $Date: 2004-01-13 01:08:41 -0500 (Tue, 13 Jan 2004) $
| Constructor Summary | |
|---|---|
| AbstractPathComponent()
Creates a new AbstractPathComponent | |
| Method Summary | |
|---|---|
| void | addPredicate(XPathExpression expr)
Adds the given Expression to this PathComponent's predicate
List.
|
| void | addPredicate(PredicateExprImpl predicate)
Adds the given Expression to this PathComponent'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 PathComponent against the
given Node.
|
| 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() |
| PredicateExpr | getPredicate()
Returns the PredicateExpr of this PathComponent
|
| abstract XPathExpression | getSubExpression()
Returns the sub-expression encapsulated by this PathComponent.
the sub-expression will either be a PrimaryExpr if this
PathComponent is a FilterExpr, or a NodeExpression if this
Pathcomponent is a LocationStep. |
| boolean | hasPredicates()
Returns true if this FilterBase has predicates expressions.
|
| abstract boolean | isFilterExpr()
Returns true if this PathComponent is a FilterExpr.
|
| abstract boolean | isLocationStep()
Returns true if this PathComponent is a LocationStep.
|
| 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 PathComponent
|
Parameters: expr the Expr to add to the predicate list
Parameters: expr the Expr to add to the predicate list
Parameters: context The XPathContext to use during evaluation.
Returns: The XPathResult (not null).
Throws: XPathException if an error occured while evaluating this expression.
Parameters: nodes the current NodeSet contextInfo provides a way to retrieve additional context information needed to evaluate some expressions
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
Returns: the priority for this PatternExpr
Returns: the PredicateExpr of this PathComponent
Returns: the sub-expression encapsulated by this PathComponent.
Returns: true if this FilterBase has predicates expressions.
Returns: true if this PathComponent is a FilterExpr
See Also: isLocationStep
Returns: true if this PathComponent is a LocationStep
See Also: isFilterExpr
Parameters: node the node to determine a match for context the XPathContext
Returns: true if the given node is matched by this MatchExpr
Throws: XPathException when an error occurs during evaluation
Returns: the String representation of this PathComponent