Class PathExpr
- java.lang.Object
-
- org.exolab.adaptx.xpath.expressions.PathExpr
-
- All Implemented Interfaces:
MatchExpression
,XPathExpression
public abstract class PathExpr extends java.lang.Object implements XPathExpression, MatchExpression
An abstract class representing an XPath Location Path expression.- Version:
- $Revision: 3734 $ $Date: 2003-05-13 09:55:04 +0200 (Tue, 13 May 2003) $
- Author:
- Keith Visco
-
-
Field Summary
-
Fields inherited from interface org.exolab.adaptx.xpath.XPathExpression
BOOLEAN, ERROR, FILTER_EXPR, LOCATION_PATH, NODE_TEST, NUMBER, PATH_EXPR, PRIMARY, STEP, STRING, UNION_EXPR
-
-
Constructor Summary
Constructors Constructor Description PathExpr()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract XPathResult
evaluate(XPathContext context)
Evaluates the expression and returns the XPath result.abstract double
getDefaultPriority()
Determines the priority of a PatternExpr as follows:short
getExprType()
Returns the XPathExpression typeabstract PathComponent
getPathComponent()
Returns the PathComponent for the this PathExpr, either a FilterExpr or LocationStep.abstract PathExpr
getSubPath()
abstract boolean
isAbsolute()
Returns true if this PathExpr is an absolute expression, otherwise false (ie.abstract boolean
matches(XPathNode node, XPathContext context)
Determines if the given node is matched by this MatchExpr with respect to the given context.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.exolab.adaptx.xpath.XPathExpression
toString
-
-
-
-
Method Detail
-
evaluate
public abstract XPathResult evaluate(XPathContext context) throws XPathException
Evaluates the expression and returns the XPath result.- Specified by:
evaluate
in interfaceXPathExpression
- Parameters:
context
- The XPathContext to use during evaluation.- Returns:
- The XPathResult (not null).
- Throws:
XPathException
- if an error occured while evaluating this expression.
-
getExprType
public final short getExprType()
Returns the XPathExpression type- Specified by:
getExprType
in interfaceXPathExpression
- Returns:
- the XPathExpression type
- See Also:
XPathExpression
-
getPathComponent
public abstract PathComponent getPathComponent()
Returns the PathComponent for the this PathExpr, either a FilterExpr or LocationStep.- Returns:
- the PathComponent for this PathExpr
-
getSubPath
public abstract PathExpr getSubPath()
-
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
-
isAbsolute
public abstract boolean isAbsolute()
Returns true if this PathExpr is an absolute expression, otherwise false (ie. it's a relative expression).- Returns:
- true if this PathExpr is an absolute expression.
-
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.- Specified by:
matches
in interfaceMatchExpression
- Parameters:
node
- the node to determine a match forcontext
- the XPathContext- Returns:
- true if the given node is matched by this MatchExpr
- Throws:
XPathException
- when an error occurs during evaluation
-
-