Class NAryQueryNode<T extends QueryNode>
java.lang.Object
org.apache.jackrabbit.spi.commons.query.QueryNode
org.apache.jackrabbit.spi.commons.query.NAryQueryNode<T>
- Direct Known Subclasses:
AndQueryNode,LocationStepQueryNode,NotQueryNode,OrQueryNode,PathQueryNode,RelationQueryNode
Defines an abstract query node for nodes that have child nodes.
-
Field Summary
Fields 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 -
Constructor Summary
ConstructorsConstructorDescriptionNAryQueryNode(QueryNode parent) Creates a newNAryQueryNodewith a reference to a parentQueryNode.NAryQueryNode(QueryNode parent, T[] operands) -
Method Summary
Modifier and TypeMethodDescriptionObject[]acceptOperands(QueryNodeVisitor visitor, Object data) Helper class to accept avisitorfor all operands of thisNAryQueryNode.voidaddOperand(T operand) Adds a newoperand(child node) to this query node.booleanReturnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.intReturns the number of operands.Returns an array of currently setQueryNodeoperands of thisQueryNode.booleanReturnstrueif this query node needs items under /jcr:system to be queried.booleanremoveOperand(T operand) Removes anoperand(child node) from this query node.
-
Constructor Details
-
NAryQueryNode
Creates a newNAryQueryNodewith a reference to a parentQueryNode.- Parameters:
parent- the parent node.
-
NAryQueryNode
- Parameters:
parent- the parent node.operands- child nodes of thisNAryQueryNode.
-
-
Method Details
-
addOperand
Adds a newoperand(child node) to this query node.- Parameters:
operand- the childQueryNodeto add.
-
removeOperand
Removes anoperand(child node) from this query node.- Parameters:
operand- the child to remove.- Returns:
trueif the operand was in the list of child nodes and has been removed;falseif this node does not containoperandas a child node.
-
getOperands
Returns an array of currently setQueryNodeoperands of thisQueryNode. Returns an empty array if no operands are set.- Returns:
- currently set
QueryNodeoperands.
-
getNumOperands
public int getNumOperands()Returns the number of operands.- Returns:
- the number of operands.
-
acceptOperands
Helper class to accept avisitorfor all operands of thisNAryQueryNode.- Parameters:
visitor- the visitor to call back.data- arbitrary data for the visitor.- Returns:
- the return values of the
visitor.visit()calls. - Throws:
RepositoryException- if an error occurs.
-
equals
Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode. -
needsSystemTree
public boolean needsSystemTree()Returnstrueif this query node needs items under /jcr:system to be queried.- Specified by:
needsSystemTreein classQueryNode- Returns:
trueif this query node needs content under /jcr:system to be queried;falseotherwise.
-