Class QueryRootNode
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.query.QueryNode
-
- org.apache.jackrabbit.spi.commons.query.QueryRootNode
-
public class QueryRootNode extends QueryNode
Implements the root node of a query tree.
-
-
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
Constructors Modifier Constructor Description protected
QueryRootNode()
Creates a newQueryRootNode
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
accept(QueryNodeVisitor visitor, Object data)
Accepts aQueryNodeVisitor
and calls the appropriatevisit
method on the visitor depending on the concrete implementation of thisQueryNode
.void
addSelectProperty(Name propName)
Adds a new select property to the query.boolean
equals(Object obj)
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node.PathQueryNode
getLocationNode()
Returns thePathQueryNode
ornull
if this query does not have a location node.OrderQueryNode
getOrderNode()
Returns the order node ornull
if no order is specified.Name[]
getSelectProperties()
Returns an array of select properties.int
getType()
Returns the type of this node.boolean
needsSystemTree()
Returnstrue
if this query node needs items under /jcr:system to be queried.void
setLocationNode(PathQueryNode locationNode)
Sets the location node.void
setOrderNode(OrderQueryNode orderNode)
Sets a new order node.
-
-
-
Method Detail
-
getLocationNode
public PathQueryNode getLocationNode()
Returns thePathQueryNode
ornull
if this query does not have a location node.- Returns:
- the
PathQueryNode
ornull
if this query does not have a location node.
-
setLocationNode
public void setLocationNode(PathQueryNode locationNode)
Sets the location node.- Parameters:
locationNode
- the new location node.
-
addSelectProperty
public void addSelectProperty(Name propName)
Adds a new select property to the query.- Parameters:
propName
- the name of the property to select.
-
getSelectProperties
public Name[] getSelectProperties()
Returns an array of select properties.- Returns:
- an array of select properties.
-
getOrderNode
public OrderQueryNode getOrderNode()
Returns the order node ornull
if no order is specified.- Returns:
- the order node.
-
setOrderNode
public void setOrderNode(OrderQueryNode orderNode)
Sets a new order node.- Parameters:
orderNode
- the new order node.
-
accept
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException
Accepts aQueryNodeVisitor
and calls the appropriatevisit
method on the visitor depending on the concrete implementation of thisQueryNode
.- Specified by:
accept
in 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 node.
-
equals
public boolean equals(Object obj)
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node.
-
needsSystemTree
public boolean needsSystemTree()
Returnstrue
if this query node needs items under /jcr:system to be queried.- Specified by:
needsSystemTree
in classQueryNode
- Returns:
true
if this query node needs content under /jcr:system to be queried;false
otherwise.
-
-