Class LocationStepQueryNode
java.lang.Object
org.apache.jackrabbit.spi.commons.query.QueryNode
org.apache.jackrabbit.spi.commons.query.NAryQueryNode<QueryNode>
org.apache.jackrabbit.spi.commons.query.LocationStepQueryNode
- Direct Known Subclasses:
DerefQueryNode
Defines a location step for querying the path of a node.
/foo -> descendants = false, nameTest = foo
//foo -> descendants = true, nameTest = foo
//* -> descendants = true, nameTest = null
/* -> descendants = false, nameTest = null
/ -> descendants = false, nameTest = ""
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NameThe empty name used in matching the root node.static final intConstant value for position index = last()static final intConstant value to indicate no position indexFields inherited from class org.apache.jackrabbit.spi.commons.query.QueryNode
TYPE_AND, TYPE_DEREF, TYPE_EXACT, TYPE_LOCATION, TYPE_NODETYPE, TYPE_NOT, TYPE_OR, TYPE_ORDER, TYPE_PATH, TYPE_PROP_FUNCTION, TYPE_RELATION, TYPE_ROOT, TYPE_TEXTSEARCH -
Method Summary
Modifier and TypeMethodDescriptionaccept(QueryNodeVisitor visitor, Object data) Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.voidaddPredicate(QueryNode predicate) Adds a predicate node to this location step.booleanReturnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.booleanReturnstrueif this location step uses the descendant-or-self axis,falseif this step uses the child axis.intgetIndex()Returns the position index for this step.Returns the label of the node for this location step, ornullif the name test is '*'.Returns the predicate nodes for this location step.intgetType()Returns the type of this query node.voidsetIncludeDescendants(boolean include) Sets a new value for the includeDescendants property.voidsetIndex(int index) Sets the position index for this step.voidsetNameTest(Name nameTest) Sets a new name test.Methods inherited from class org.apache.jackrabbit.spi.commons.query.NAryQueryNode
acceptOperands, addOperand, getNumOperands, getOperands, needsSystemTree, removeOperand
-
Field Details
-
LAST
public static final int LASTConstant value for position index = last()- See Also:
-
NONE
public static final int NONEConstant value to indicate no position index- See Also:
-
EMPTY_NAME
The empty name used in matching the root node. This is an implementation specific constant as the empty name is not a valid JCR name. TODO: The root location step should be refactored somehow
-
-
Method Details
-
getNameTest
Returns the label of the node for this location step, ornullif the name test is '*'.- Returns:
- the label of the node for this location step.
-
setNameTest
Sets a new name test.- Parameters:
nameTest- the name test ornullto match all names.
-
getIncludeDescendants
public boolean getIncludeDescendants()Returnstrueif this location step uses the descendant-or-self axis,falseif this step uses the child axis.- Returns:
trueif this step uses the descendant-or-self axis.
-
setIncludeDescendants
public void setIncludeDescendants(boolean include) Sets a new value for the includeDescendants property.- Parameters:
include- the new value.- See Also:
-
addPredicate
Adds a predicate node to this location step.- Parameters:
predicate- the node to add.
-
getPredicates
Returns the predicate nodes for this location step. This method may also return a position predicate.- Returns:
- the predicate nodes or an empty array if there are no predicates for this location step.
-
setIndex
public void setIndex(int index) Sets the position index for this step. A value ofNONEindicates that this location step has no position index assigned. That is, the step selects all same name siblings.- Parameters:
index- the position index.
-
getIndex
public int getIndex()Returns the position index for this step. A value ofNONEindicates that this location step has no position index assigned. That is, the step selects all same name siblings.- Returns:
- the position index for this step.
-
accept
Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.- Specified by:
acceptin classQueryNode- Parameters:
visitor- the visitor to call back.data- arbitrary data for the visitor.- Returns:
- the return value of the
visitor.visit()call. - Throws:
RepositoryException
-
getType
public int getType()Returns the type of this query node. -
equals
Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.- Overrides:
equalsin classNAryQueryNode<QueryNode>- Parameters:
obj- the reference object with which to compare.- Returns:
trueifobjis equal tothis;falseotherwise.
-