public class StepPattern extends NodeTest implements SubContextList
| Modifier and Type | Field and Description |
|---|---|
protected int |
m_axis
The axis for this test.
|
m_name, m_whatToShow, SCORE_NODETEST, SCORE_NONE, SCORE_NSWILD, SCORE_OTHER, SCORE_QNAME, SHOW_BYFUNCTION, WILD| Constructor and Description |
|---|
StepPattern(int whatToShow,
int axis)
Construct a StepPattern that doesn't test for node names.
|
StepPattern(int whatToShow,
String namespace,
String name,
int axis)
Construct a StepPattern that tests for namespaces and node names.
|
| Modifier and Type | Method and Description |
|---|---|
void |
calcScore()
Static calc of match score.
|
void |
calcTargetString()
Calculate the local name or psuedo name of the node that this pattern will test, for hash table
lookup optimization.
|
protected void |
callSubtreeVisitors(XPathVisitor visitor)
Call the visitors on the subtree.
|
void |
callVisitors(XPathVisitor visitor)
This will traverse the hierarchy, calling the visitor for each member.
|
boolean |
canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.
|
boolean |
deepEquals(Expression expr)
Compare this object with another object and see if they are equal, include the sub heararchy.
|
XObject |
execute(XPathContext xctxt)
Execute an expression in the XPath runtime context, and return the result of the expression.
|
XObject |
execute(XPathContext xctxt,
int currentNode)
Execute an expression in the XPath runtime context, and return the result of the expression.
|
XObject |
execute(XPathContext xctxt,
int currentNode,
DTM dtm,
int expType)
Execute an expression in the XPath runtime context, and return the result of the expression.
|
protected boolean |
executePredicates(XPathContext xctxt,
DTM dtm,
int currentNode)
Execute the predicates on this step to determine if the current node should be filtered or
accepted.
|
protected XObject |
executeRelativePathPattern(XPathContext xctxt,
DTM dtm,
int currentNode)
Execute the match pattern step relative to another step.
|
int |
getAxis()
Get the axis that this step follows.
|
int |
getLastPos(XPathContext xctxt)
Get the number of nodes in the node list, which, in the XSLT 1 based counting system, is the
last index position.
|
Expression |
getPredicate(int i)
Get a predicate expression.
|
int |
getPredicateCount()
Get the number of predicates for this match pattern step.
|
Expression[] |
getPredicates()
Set the list of predicate expressions for this pattern step.
|
int |
getProximityPosition(XPathContext xctxt)
Get the current sub-context position.
|
StepPattern |
getRelativePathPattern()
Get the reference to nodetest and predicate for parent or ancestor.
|
void |
setAxis(int axis)
Set the axis that this step should follow.
|
void |
setPredicates(Expression[] predicates)
Set the predicates for this match pattern step.
|
void |
setRelativePathPattern(StepPattern expr)
Set the reference to nodetest and predicate for parent or ancestor.
|
String |
toString() |
getLocalName, getNamespace, getNodeTypeTest, getStaticScore, getWhatToShow, initNodeTest, initNodeTest, setLocalName, setNamespace, setStaticScore, setWhatToShowasIterator, asNode, assertion, bool, error, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, numpublic StepPattern(int whatToShow,
String namespace,
String name,
int axis)
whatToShow - Bit set defined mainly by NodeFilter.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.public StepPattern(int whatToShow,
int axis)
whatToShow - Bit set defined mainly by NodeFilter.axis - The Axis for this test, one of of Axes.ANCESTORORSELF, etc.public void calcTargetString()
PseudoNamespublic void setRelativePathPattern(StepPattern expr)
expr - The relative pattern expression.public StepPattern getRelativePathPattern()
public Expression[] getPredicates()
public boolean canTraverseOutsideSubtree()
canTraverseOutsideSubtree in class Expressionpublic Expression getPredicate(int i)
i - The index of the predicate.public final int getPredicateCount()
public void setPredicates(Expression[] predicates)
predicates - An array of expressions that define predicates for this step.public void calcScore()
public XObject execute(XPathContext xctxt, int currentNode) throws TransformerException
execute in class NodeTestxctxt - The XPath runtime context.currentNode - The currentNode.XObject.TransformerException - if a runtime exception occurs.public XObject execute(XPathContext xctxt) throws TransformerException
execute in class NodeTestxctxt - The XPath runtime context.XObject.TransformerException - if a runtime exception occurs.public XObject execute(XPathContext xctxt, int currentNode, DTM dtm, int expType) throws TransformerException
execute in class NodeTestxctxt - The XPath runtime context.currentNode - The currentNode.dtm - The DTM of the current node.expType - The expanded type ID of the current node.XObject.TransformerException - if a runtime exception occurs.public int getProximityPosition(XPathContext xctxt)
getProximityPosition in interface SubContextListxctxt - The XPath runtime context.public int getLastPos(XPathContext xctxt)
getLastPos in interface SubContextListxctxt - The XPath runtime context.protected final XObject executeRelativePathPattern(XPathContext xctxt, DTM dtm, int currentNode) throws TransformerException
xctxt - The XPath runtime context.dtm - The DTM of the current node.currentNode - The current node context.NodeTest.SCORE_NODETEST, NodeTest.SCORE_NONE, NodeTest.SCORE_NSWILD, NodeTest.SCORE_QNAME, or NodeTest.SCORE_OTHER.TransformerException - in case of errorprotected final boolean executePredicates(XPathContext xctxt, DTM dtm, int currentNode) throws TransformerException
xctxt - The XPath runtime context.dtm - The DTM of the current node.currentNode - The current node context.TransformerException - in case of errorpublic void setAxis(int axis)
axis - The Axis for this test, one of of Axes.ANCESTORORSELF, etc.public int getAxis()
public void callVisitors(XPathVisitor visitor)
callVisitors in interface XPathVisitablecallVisitors in class NodeTestvisitor - The visitor whose appropriate method will be called.protected void callSubtreeVisitors(XPathVisitor visitor)
public boolean deepEquals(Expression expr)
deepEquals in class NodeTestexpr - Another expression object.Copyright © 2022–2023 HtmlUnit. All rights reserved.