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 protectedQueryRootNode()Creates a newQueryRootNodeinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectaccept(QueryNodeVisitor visitor, Object data)Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.voidaddSelectProperty(Name propName)Adds a new select property to the query.booleanequals(Object obj)Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.PathQueryNodegetLocationNode()Returns thePathQueryNodeornullif this query does not have a location node.OrderQueryNodegetOrderNode()Returns the order node ornullif no order is specified.Name[]getSelectProperties()Returns an array of select properties.intgetType()Returns the type of this node.booleanneedsSystemTree()Returnstrueif this query node needs items under /jcr:system to be queried.voidsetLocationNode(PathQueryNode locationNode)Sets the location node.voidsetOrderNode(OrderQueryNode orderNode)Sets a new order node.
-
-
-
Method Detail
-
getLocationNode
public PathQueryNode getLocationNode()
Returns thePathQueryNodeornullif this query does not have a location node.- Returns:
- the
PathQueryNodeornullif 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 ornullif 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 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 node.
-
equals
public boolean equals(Object obj)
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.
-
-