| java.lang.Object org.apache.xpath.axes.WalkerFactory
WalkerFactory | public class WalkerFactory (Code) | | This class is both a factory for XPath location path expressions,
which are built from the opcode map output, and an analysis engine
for the location path expressions in order to provide optimization hints.
|
Field Summary | |
final public static int | BITMASK_TRAVERSES_OUTSIDE_SUBTREE If any of these bits are on, the expression may likely traverse outside
the given subtree. | final public static int | BITS_COUNT First 8 bits are the number of top-level location steps. | final public static int | BITS_RESERVED 4 bits are reserved for future use. | final public static int | BIT_ANCESTOR Bit is on if any of the walkers contain an ancestor step. | final public static int | BIT_ANCESTOR_OR_SELF Bit is on if any of the walkers contain an ancestor-or-self step. | final public static int | BIT_ANY_DESCENDANT_FROM_ROOT | final public static int | BIT_ATTRIBUTE Bit is on if any of the walkers contain an attribute step. | final public static int | BIT_BACKWARDS_SELF Bit is on if any of the walkers can go backwards in document
order from the context node. | final public static int | BIT_CHILD Bit is on if any of the walkers contain a child step. | final public static int | BIT_DESCENDANT Bit is on if any of the walkers contain a descendant step. | final public static int | BIT_DESCENDANT_OR_SELF Bit is on if any of the walkers contain a descendant-or-self step. | final public static int | BIT_FILTER Bit is on if any of the walkers contain a filter (i.e. | final public static int | BIT_FOLLOWING Bit is on if any of the walkers contain a following step. | final public static int | BIT_FOLLOWING_SIBLING Bit is on if any of the walkers contain a following-sibiling step. | final public static int | BIT_MATCH_PATTERN Bit is on if the expression is a match pattern. | final public static int | BIT_NAMESPACE Bit is on if any of the walkers contain a namespace step. | final public static int | BIT_NODETEST_ANY Bit is on if any of the walkers contain an node() test. | final public static int | BIT_PARENT Bit is on if any of the walkers contain a parent step. | final public static int | BIT_PRECEDING Bit is on if any of the walkers contain a preceding step. | final public static int | BIT_PRECEDING_SIBLING Bit is on if any of the walkers contain a preceding-sibling step. | final public static int | BIT_PREDICATE Bit is on if the expression contains a top-level predicate. | final public static int | BIT_ROOT Bit is on if any of the walkers contain a root step. | final public static int | BIT_SELF Bit is on if any of the walkers contain a self step. | final static boolean | DEBUG_ITERATOR_CREATION | final static boolean | DEBUG_PATTERN_CREATION | final static boolean | DEBUG_WALKER_CREATION |
Method Summary | |
static boolean | analyzePredicate(Compiler compiler, int opPos, int stepType) Analyze a step and give information about it's predicates. | public static boolean | canCrissCross(int analysis) | public static boolean | canSkipSubtrees(int analysis) | public static void | diagnoseIterator(String name, int analysis, Compiler compiler) | static boolean | functionProximateOrContainsProximate(Compiler compiler, int opPos) | public static int | getAnalysisBitFromAxes(int axis) Get a corresponding BIT_XXX from an axis.
Parameters: axis - One of Axis.ANCESTOR, etc. | public static String | getAnalysisString(int analysis) | public static int | getAxisFromStep(Compiler compiler, int stepOpCodePos) Special purpose function to see if we can optimize the pattern for
a DescendantIterator.
Parameters: compiler - non-null reference to compiler object that has processedthe XPath operations into an opcode map. Parameters: stepOpCodePos - The opcode position for the step. | public static int | getStepCount(int analysis) | public static boolean | hasPredicate(int analysis) | public static boolean | isAbsolute(int analysis) | public static boolean | isDownwardAxisOfMany(int axis) Tell if the given axis goes downword. | public static boolean | isNaturalDocOrder(int analysis) Tell if the pattern can be 'walked' with the iteration steps in natural
document order, without duplicates.
Parameters: analysis - The general analysis of the pattern. | public static boolean | isOneStep(int analysis) | static boolean | isProximateInnerExpr(Compiler compiler, int opPos) | public static boolean | isSet(int analysis, int bits) | public static boolean | isWild(int analysis) | static AxesWalker | loadOneWalker(WalkingIterator lpi, Compiler compiler, int stepOpCodePos) This method is for building an array of possible levels
where the target element(s) could be found for a match.
Parameters: lpi - The owning location path iterator. Parameters: compiler - non-null reference to compiler object that has processedthe XPath operations into an opcode map. Parameters: stepOpCodePos - The opcode position for the step. | static StepPattern | loadSteps(MatchPatternIterator mpi, Compiler compiler, int stepOpCodePos, int stepIndex) Read a LocationPath
as a generalized match pattern. | static AxesWalker | loadWalkers(WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex) This method is for building an array of possible levels
where the target element(s) could be found for a match.
Parameters: lpi - The owning location path iterator object. Parameters: compiler - non-null reference to compiler object that has processedthe XPath operations into an opcode map. Parameters: stepOpCodePos - The opcode position for the step. Parameters: stepIndex - The top-level step index withing the iterator. | public static boolean | mightBeProximate(Compiler compiler, int opPos, int stepType) Tell if the predicates need to have proximity knowledge. | public static DTMIterator | newDTMIterator(Compiler compiler, int opPos, boolean isTopLevel) Create a new LocPathIterator iterator. | public static boolean | walksAncestors(int analysis) | public static boolean | walksAttributes(int analysis) | public static boolean | walksChildren(int analysis) | public static boolean | walksChildrenAndExtraAndSelfOnly(int analysis) | public static boolean | walksChildrenOnly(int analysis) | public static boolean | walksDescendants(int analysis) | public static boolean | walksDescendantsAndExtraAndSelfOnly(int analysis) | public static boolean | walksDownExtraOnly(int analysis) | public static boolean | walksDownOnly(int analysis) | public static boolean | walksExtraNodes(int analysis) | public static boolean | walksExtraNodesOnly(int analysis) | public static boolean | walksFilteredList(int analysis) | public static boolean | walksFollowingOnlyMaybeAbsolute(int analysis) | public static boolean | walksInDocOrder(int analysis) | public static boolean | walksNamespaces(int analysis) | public static boolean | walksSelfOnly(int analysis) | public static boolean | walksSideways(int analysis) | public static boolean | walksSubtree(int analysis) | public static boolean | walksSubtreeOnly(int analysis) | public static boolean | walksSubtreeOnlyFromRootOrContext(int analysis) | public static boolean | walksSubtreeOnlyMaybeAbsolute(int analysis) | public static boolean | walksUp(int analysis) | public static boolean | walksUpOnly(int analysis) |
BITMASK_TRAVERSES_OUTSIDE_SUBTREE | final public static int BITMASK_TRAVERSES_OUTSIDE_SUBTREE(Code) | | If any of these bits are on, the expression may likely traverse outside
the given subtree.
|
BITS_COUNT | final public static int BITS_COUNT(Code) | | First 8 bits are the number of top-level location steps. Hopefully
there will never be more that 255 location steps!!!
|
BITS_RESERVED | final public static int BITS_RESERVED(Code) | | 4 bits are reserved for future use.
|
BIT_ANCESTOR | final public static int BIT_ANCESTOR(Code) | | Bit is on if any of the walkers contain an ancestor step.
|
BIT_ANCESTOR_OR_SELF | final public static int BIT_ANCESTOR_OR_SELF(Code) | | Bit is on if any of the walkers contain an ancestor-or-self step.
|
BIT_ANY_DESCENDANT_FROM_ROOT | final public static int BIT_ANY_DESCENDANT_FROM_ROOT(Code) | | Found "//foo" pattern
|
BIT_ATTRIBUTE | final public static int BIT_ATTRIBUTE(Code) | | Bit is on if any of the walkers contain an attribute step.
|
BIT_BACKWARDS_SELF | final public static int BIT_BACKWARDS_SELF(Code) | | Bit is on if any of the walkers can go backwards in document
order from the context node.
|
BIT_CHILD | final public static int BIT_CHILD(Code) | | Bit is on if any of the walkers contain a child step.
|
BIT_DESCENDANT | final public static int BIT_DESCENDANT(Code) | | Bit is on if any of the walkers contain a descendant step.
|
BIT_DESCENDANT_OR_SELF | final public static int BIT_DESCENDANT_OR_SELF(Code) | | Bit is on if any of the walkers contain a descendant-or-self step.
|
BIT_FILTER | final public static int BIT_FILTER(Code) | | Bit is on if any of the walkers contain a filter (i.e. id(), extension
function, etc.) step.
|
BIT_FOLLOWING | final public static int BIT_FOLLOWING(Code) | | Bit is on if any of the walkers contain a following step.
|
BIT_FOLLOWING_SIBLING | final public static int BIT_FOLLOWING_SIBLING(Code) | | Bit is on if any of the walkers contain a following-sibiling step.
|
BIT_MATCH_PATTERN | final public static int BIT_MATCH_PATTERN(Code) | | Bit is on if the expression is a match pattern.
|
BIT_NAMESPACE | final public static int BIT_NAMESPACE(Code) | | Bit is on if any of the walkers contain a namespace step.
|
BIT_NODETEST_ANY | final public static int BIT_NODETEST_ANY(Code) | | Bit is on if any of the walkers contain an node() test. This is
really only useful if the count is 1.
|
BIT_PARENT | final public static int BIT_PARENT(Code) | | Bit is on if any of the walkers contain a parent step.
|
BIT_PRECEDING | final public static int BIT_PRECEDING(Code) | | Bit is on if any of the walkers contain a preceding step.
|
BIT_PRECEDING_SIBLING | final public static int BIT_PRECEDING_SIBLING(Code) | | Bit is on if any of the walkers contain a preceding-sibling step.
|
BIT_PREDICATE | final public static int BIT_PREDICATE(Code) | | Bit is on if the expression contains a top-level predicate.
|
BIT_ROOT | final public static int BIT_ROOT(Code) | | Bit is on if any of the walkers contain a root step.
|
BIT_SELF | final public static int BIT_SELF(Code) | | Bit is on if any of the walkers contain a self step.
|
DEBUG_ITERATOR_CREATION | final static boolean DEBUG_ITERATOR_CREATION(Code) | | Set to true for diagnostics about iterator creation
|
DEBUG_PATTERN_CREATION | final static boolean DEBUG_PATTERN_CREATION(Code) | | Set to true for diagnostics about walker creation
|
DEBUG_WALKER_CREATION | final static boolean DEBUG_WALKER_CREATION(Code) | | Set to true for diagnostics about walker creation
|
analyzePredicate | static boolean analyzePredicate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException(Code) | | Analyze a step and give information about it's predicates. Right now this
just returns true or false if the step has a predicate.
Parameters: compiler - non-null reference to compiler object that has processedthe XPath operations into an opcode map. Parameters: opPos - The opcode position for the step. Parameters: stepType - The type of step, one of OP_GROUP, etc. true if step has a predicate. throws: javax.xml.transform.TransformerException - |
canCrissCross | public static boolean canCrissCross(int analysis)(Code) | | |
canSkipSubtrees | public static boolean canSkipSubtrees(int analysis)(Code) | | |
diagnoseIterator | public static void diagnoseIterator(String name, int analysis, Compiler compiler)(Code) | | |
functionProximateOrContainsProximate | static boolean functionProximateOrContainsProximate(Compiler compiler, int opPos)(Code) | | |
getAnalysisBitFromAxes | public static int getAnalysisBitFromAxes(int axis)(Code) | | Get a corresponding BIT_XXX from an axis.
Parameters: axis - One of Axis.ANCESTOR, etc. One of BIT_ANCESTOR, etc. |
getAnalysisString | public static String getAnalysisString(int analysis)(Code) | | |
getAxisFromStep | public static int getAxisFromStep(Compiler compiler, int stepOpCodePos) throws javax.xml.transform.TransformerException(Code) | | Special purpose function to see if we can optimize the pattern for
a DescendantIterator.
Parameters: compiler - non-null reference to compiler object that has processedthe XPath operations into an opcode map. Parameters: stepOpCodePos - The opcode position for the step. 32 bits as an integer that give information about the locationpath as a whole. throws: javax.xml.transform.TransformerException - |
getStepCount | public static int getStepCount(int analysis)(Code) | | |
hasPredicate | public static boolean hasPredicate(int analysis)(Code) | | |
isAbsolute | public static boolean isAbsolute(int analysis)(Code) | | |
isDownwardAxisOfMany | public static boolean isDownwardAxisOfMany(int axis)(Code) | | Tell if the given axis goes downword. Bogus name, if you can think of
a better one, please do tell. This really has to do with inverting
attribute axis.
Parameters: axis - One of Axis.XXX. true if the axis is not a child axis and does not go up from the axis root. |
isNaturalDocOrder | public static boolean isNaturalDocOrder(int analysis)(Code) | | Tell if the pattern can be 'walked' with the iteration steps in natural
document order, without duplicates.
Parameters: analysis - The general analysis of the pattern. true if the walk can be done in natural order. throws: javax.xml.transform.TransformerException - |
isOneStep | public static boolean isOneStep(int analysis)(Code) | | |
isProximateInnerExpr | static boolean isProximateInnerExpr(Compiler compiler, int opPos)(Code) | | |
isSet | public static boolean isSet(int analysis, int bits)(Code) | | |
isWild | public static boolean isWild(int analysis)(Code) | | |
loadSteps | static StepPattern loadSteps(MatchPatternIterator mpi, Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException(Code) | | Read a LocationPath
as a generalized match pattern. What this means is that the LocationPath
is read backwards, as a test on a given node, to see if it matches the
criteria of the selection, and ends up at the context node. Essentially,
this is a backwards query from a given node, to find the context node.
So, the selection "foo/daz[2]" is, in non-abreviated expanded syntax,
"self::node()/following-sibling::foo/child::daz[position()=2]".
Taking this as a match pattern for a probable node, it works out to
"self::daz/parent::foo[child::daz[position()=2 and isPrevStepNode()]
precedingSibling::node()[isContextNodeOfLocationPath()]", adding magic
isPrevStepNode and isContextNodeOfLocationPath operations. Predicates in
the location path have to be executed by the following step,
because they have to know the context of their execution.
Parameters: mpi - The MatchPatternIterator to which the steps will be attached. Parameters: compiler - The compiler that holds the syntax tree/op map toconstruct from. Parameters: stepOpCodePos - The current op code position within the opmap. Parameters: stepIndex - The top-level step index withing the iterator. A StepPattern object, which may contain relative StepPatterns. throws: javax.xml.transform.TransformerException - |
loadWalkers | static AxesWalker loadWalkers(WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException(Code) | | This method is for building an array of possible levels
where the target element(s) could be found for a match.
Parameters: lpi - The owning location path iterator object. Parameters: compiler - non-null reference to compiler object that has processedthe XPath operations into an opcode map. Parameters: stepOpCodePos - The opcode position for the step. Parameters: stepIndex - The top-level step index withing the iterator. non-null AxesWalker derivative. throws: javax.xml.transform.TransformerException - |
newDTMIterator | public static DTMIterator newDTMIterator(Compiler compiler, int opPos, boolean isTopLevel) throws javax.xml.transform.TransformerException(Code) | | Create a new LocPathIterator iterator. The exact type of iterator
returned is based on an analysis of the XPath operations.
Parameters: compiler - non-null reference to compiler object that has processedthe XPath operations into an opcode map. Parameters: opPos - The position of the operation code for this itterator. non-null reference to a LocPathIterator or derivative. throws: javax.xml.transform.TransformerException - |
walksAncestors | public static boolean walksAncestors(int analysis)(Code) | | |
walksAttributes | public static boolean walksAttributes(int analysis)(Code) | | |
walksChildren | public static boolean walksChildren(int analysis)(Code) | | |
walksChildrenAndExtraAndSelfOnly | public static boolean walksChildrenAndExtraAndSelfOnly(int analysis)(Code) | | |
walksChildrenOnly | public static boolean walksChildrenOnly(int analysis)(Code) | | |
walksDescendants | public static boolean walksDescendants(int analysis)(Code) | | |
walksDescendantsAndExtraAndSelfOnly | public static boolean walksDescendantsAndExtraAndSelfOnly(int analysis)(Code) | | |
walksDownExtraOnly | public static boolean walksDownExtraOnly(int analysis)(Code) | | |
walksDownOnly | public static boolean walksDownOnly(int analysis)(Code) | | |
walksExtraNodes | public static boolean walksExtraNodes(int analysis)(Code) | | |
walksExtraNodesOnly | public static boolean walksExtraNodesOnly(int analysis)(Code) | | |
walksFilteredList | public static boolean walksFilteredList(int analysis)(Code) | | |
walksFollowingOnlyMaybeAbsolute | public static boolean walksFollowingOnlyMaybeAbsolute(int analysis)(Code) | | |
walksInDocOrder | public static boolean walksInDocOrder(int analysis)(Code) | | |
walksNamespaces | public static boolean walksNamespaces(int analysis)(Code) | | |
walksSelfOnly | public static boolean walksSelfOnly(int analysis)(Code) | | |
walksSideways | public static boolean walksSideways(int analysis)(Code) | | |
walksSubtree | public static boolean walksSubtree(int analysis)(Code) | | |
walksSubtreeOnly | public static boolean walksSubtreeOnly(int analysis)(Code) | | |
walksSubtreeOnlyFromRootOrContext | public static boolean walksSubtreeOnlyFromRootOrContext(int analysis)(Code) | | |
walksSubtreeOnlyMaybeAbsolute | public static boolean walksSubtreeOnlyMaybeAbsolute(int analysis)(Code) | | |
walksUp | public static boolean walksUp(int analysis)(Code) | | |
walksUpOnly | public static boolean walksUpOnly(int analysis)(Code) | | |
|
|