Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.xpath.Expression
org.apache.xpath.patterns.NodeTest
org.apache.xpath.patterns.StepPattern
Field Summary |
Fields inherited from class org.apache.xpath.patterns.NodeTest | |
SCORE_NODETEST , SCORE_NONE , SCORE_NSWILD , SCORE_OTHER , SCORE_QNAME , SHOW_BYFUNCTION , SUPPORTS_PRE_STRIPPING , WILD |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
boolean |
|
boolean |
|
XObject |
|
XObject |
|
XObject |
|
void |
|
int |
|
Expression | |
int |
|
double |
|
Expression |
|
int |
|
Expression[] |
|
int |
|
StepPattern |
|
String |
|
void |
|
void |
|
void |
|
void |
|
String |
|
Methods inherited from class org.apache.xpath.patterns.NodeTest | |
callVisitors , debugWhatToShow , deepEquals , execute , execute , execute , fixupVariables , getDefaultScore , getLocalName , getNamespace , getNodeTypeTest , getStaticScore , getWhatToShow , initNodeTest , initNodeTest , setLocalName , setNamespace , setStaticScore , setWhatToShow |
Methods inherited from class org.apache.xpath.Expression | |
asIterator , asIteratorRaw , asNode , assertion , bool , canTraverseOutsideSubtree , deepEquals , error , execute , execute , execute , execute , executeCharsToContentHandler , exprAddChild , exprGetChild , exprGetNumChildren , exprGetParent , exprSetParent , fixupVariables , getColumnNumber , getExpressionOwner , getLineNumber , getPublicId , getSystemId , isNodesetExpr , isStableNumber , num , warn , xstr |
public StepPattern(int whatToShow, String namespace, String name, int axis, int axisForPredicate)
Construct a StepPattern that tests for namespaces and node names.
- Parameters:
whatToShow
- Bit set defined mainly byNodeFilter
.namespace
- The namespace to be tested.name
- The local name to be tested.axis
- The Axis for this test, one of of Axes.ANCESTORORSELF, etc.axisForPredicate
- No longer used.
public StepPattern(int whatToShow, int axis, int axisForPredicate)
Construct a StepPattern that doesn't test for node names.
- Parameters:
whatToShow
- Bit set defined mainly byNodeFilter
.axis
- The Axis for this test, one of of Axes.ANCESTORORSELF, etc.axisForPredicate
- No longer used.
public void calcScore()
Static calc of match score.
public void calcTargetString()
Calculate the local name or psuedo name of the node that this pattern will test, for hash table lookup optimization.
- See Also:
PsuedoNames
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
- Specified by:
- callVisitors in interface XPathVisitable
- Overrides:
- callVisitors in interface NodeTest
- See Also:
XPathVisitable.callVisitors(ExpressionOwner, XPathVisitor)
public boolean canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree. NOTE: Ancestors tests with predicates are problematic, and will require special treatment.
- Overrides:
- canTraverseOutsideSubtree in interface Expression
- Returns:
- true if traversal outside the context node's subtree can occur.
public boolean deepEquals(Expression expr)
- Overrides:
- deepEquals in interface NodeTest
- See Also:
Expression.deepEquals(Expression)
public XObject execute(XPathContext xctxt) throws TransformerException
Execute this pattern step, including predicates.
- Parameters:
xctxt
- XPath runtime context.
- Throws:
TransformerException
-
public XObject execute(XPathContext xctxt, int currentNode) throws TransformerException
Execute this pattern step, including predicates.
- Parameters:
xctxt
- XPath runtime context.currentNode
- The current node context.
- Throws:
TransformerException
-
public XObject execute(XPathContext xctxt, int currentNode, DTM dtm, int expType) throws TransformerException
Execute an expression in the XPath runtime context, and return the result of the expression.
- Parameters:
xctxt
- The XPath runtime context.currentNode
- The currentNode.dtm
- The DTM of the current node.expType
- The expanded type ID of the current node.
- Returns:
- The result of the expression in the form of a
XObject
.
- Throws:
TransformerException
- if a runtime exception occurs.
public void fixupVariables(java.util.Vector vars, int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.
- Overrides:
- fixupVariables in interface NodeTest
- Parameters:
vars
- List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).globalsSize
- The number of variables in the global variable area.
public int getAxis()
Get the axis that this step follows.
- Returns:
- The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
public Expression getExpression()
- Specified by:
- getExpression in interface ExpressionOwner
- See Also:
ExpressionOwner.getExpression()
public int getLastPos(XPathContext xctxt)
Get the count of the nodes that match the test, which is the proximity position of the last node that can pass this test in the sub context selection. In XSLT 1-based indexing, this count is the index of the last node.
- Specified by:
- getLastPos in interface SubContextList
- Parameters:
xctxt
- XPath runtime context.
- Returns:
- the count of the nodes that match the test.
public double getMatchScore(XPathContext xctxt, int context) throws TransformerException
Get the match score of the given node.
- Parameters:
xctxt
- The XPath runtime context.context
- The node to be tested.
- Throws:
TransformerException
-
public Expression getPredicate(int i)
Get a predicate expression.
- Parameters:
i
- The index of the predicate.
- Returns:
- A predicate expression.
public final int getPredicateCount()
Get the number of predicates for this match pattern step.
- Returns:
- the number of predicates for this match pattern step.
public Expression[] getPredicates()
Set the list of predicate expressions for this pattern step.
- Returns:
- List of expression objects.
public int getProximityPosition(XPathContext xctxt)
Get the proximity position index of the current node based on this node test.
- Specified by:
- getProximityPosition in interface SubContextList
- Parameters:
xctxt
- XPath runtime context.
- Returns:
- the proximity position index of the current node based on the node test.
public StepPattern getRelativePathPattern()
Get the reference to nodetest and predicate for parent or ancestor.
- Returns:
- The relative pattern expression.
public String getTargetString()
Get the local name or psuedo name of the node that this pattern will test, for hash table lookup optimization.
- Returns:
- local name or psuedo name of the node.
- See Also:
PsuedoNames
public void setAxis(int axis)
Set the axis that this step should follow.
- Parameters:
axis
- The Axis for this test, one of of Axes.ANCESTORORSELF, etc.
public void setExpression(Expression exp)
- Specified by:
- setExpression in interface ExpressionOwner
public void setPredicates(Expression[] predicates)
Set the predicates for this match pattern step.
- Parameters:
predicates
- An array of expressions that define predicates for this step.
public void setRelativePathPattern(StepPattern expr)
Set the reference to nodetest and predicate for parent or ancestor.
- Parameters:
expr
- The relative pattern expression.
public String toString()
Get the string represenentation of this step for diagnostic purposes.
- Returns:
- A string representation of this step, built by reverse-engineering the contained info.