org.exolab.adaptx.xpath.expressions

Interface PathComponent

public interface PathComponent extends XPathExpression, MatchExpression

A basic interface for LocationStep or FilterExpr

Version: $Revision: 4050 $ $Date: 2004-01-13 01:04:15 -0500 (Tue, 13 Jan 2004) $

Author: Keith Visco

Method Summary
voidevaluatePredicates(NodeSet nodes, XPathContext context)
Evaluates the PredicateExpr of this PathComponent against the given NodeSet and XPathContext.
abstract doublegetDefaultPriority()
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.
  
PredicateExprgetPredicate()
Returns the PredicateExpr of this PathComponent
XPathExpressiongetSubExpression()
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.
booleanhasPredicates()
Returns true if this PathComponent has predicates expressions.
booleanisFilterExpr()
Returns true if this PathComponent is a FilterExpr.
booleanisLocationStep()
Returns true if this PathComponent is a LocationStep.

Method Detail

evaluatePredicates

public void evaluatePredicates(NodeSet nodes, XPathContext context)
Evaluates the PredicateExpr of this PathComponent against the given NodeSet and XPathContext.

Parameters: nodes the current NodeSet context the XPathContext for use during evaluation.

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
 

Returns: the priority for this PatternExpr

getPredicate

public PredicateExpr getPredicate()
Returns the PredicateExpr of this PathComponent

Returns: the PredicateExpr of this PathComponent

getSubExpression

public 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. This method may return null if no such sub-expression exists for the PathComponent.

Returns: the sub-expression encapsulated by this PathComponent.

hasPredicates

public boolean hasPredicates()
Returns true if this PathComponent has predicates expressions.

Returns: true if this PathComponent has predicates expressions.

isFilterExpr

public boolean isFilterExpr()
Returns true if this PathComponent is a FilterExpr. Note that if this method returns true, then a call to #isLocationStep must return false.

Returns: true if this PathComponent is a FilterExpr

See Also: isLocationStep

isLocationStep

public boolean isLocationStep()
Returns true if this PathComponent is a LocationStep. Note that if this method returns true, then a call to #isFilterExpr must return false.

Returns: true if this PathComponent is a LocationStep

See Also: isFilterExpr