Class QueryNode
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.query.QueryNode
-
- Direct Known Subclasses:
ExactQueryNode,NAryQueryNode,OrderQueryNode,PropertyFunctionQueryNode,QueryRootNode,TextsearchQueryNode
public abstract class QueryNode extends Object
Implements an abstract base class for nodes of a query tree that represents a query. The query tree is independent from the query syntax which is used to search the repository.
-
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_ANDType value forAndQueryNodestatic intTYPE_DEREFType value forDerefQueryNodestatic intTYPE_EXACTType value forExactQueryNodestatic intTYPE_LOCATIONType value forLocationStepQueryNodestatic intTYPE_NODETYPEType value forNodeTypeQueryNodestatic intTYPE_NOTType value forNotQueryNodestatic intTYPE_ORType value forOrQueryNodestatic intTYPE_ORDERType value forOrderQueryNodestatic intTYPE_PATHType value forPathQueryNodestatic intTYPE_PROP_FUNCTIONType value forPropertyFunctionQueryNodestatic intTYPE_RELATIONType value forRelationQueryNodestatic intTYPE_ROOTType value forQueryRootNodestatic intTYPE_TEXTSEARCHType value forTextsearchQueryNode
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Objectaccept(QueryNodeVisitor visitor, Object data)Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.Stringdump()Dumps this QueryNode and its child nodes to a String.abstract booleanequals(Object obj)Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.QueryNodegetParent()Returns the parentQueryNodeornullif this is the root node of a query tree.abstract intgetType()Returns the type of this query node.abstract booleanneedsSystemTree()Returnstrueif this query node needs items under /jcr:system to be queried.
-
-
-
Field Detail
-
TYPE_ROOT
public static final int TYPE_ROOT
Type value forQueryRootNode- See Also:
- Constant Field Values
-
TYPE_RELATION
public static final int TYPE_RELATION
Type value forRelationQueryNode- See Also:
- Constant Field Values
-
TYPE_ORDER
public static final int TYPE_ORDER
Type value forOrderQueryNode- See Also:
- Constant Field Values
-
TYPE_TEXTSEARCH
public static final int TYPE_TEXTSEARCH
Type value forTextsearchQueryNode- See Also:
- Constant Field Values
-
TYPE_EXACT
public static final int TYPE_EXACT
Type value forExactQueryNode- See Also:
- Constant Field Values
-
TYPE_NODETYPE
public static final int TYPE_NODETYPE
Type value forNodeTypeQueryNode- See Also:
- Constant Field Values
-
TYPE_AND
public static final int TYPE_AND
Type value forAndQueryNode- See Also:
- Constant Field Values
-
TYPE_OR
public static final int TYPE_OR
Type value forOrQueryNode- See Also:
- Constant Field Values
-
TYPE_NOT
public static final int TYPE_NOT
Type value forNotQueryNode- See Also:
- Constant Field Values
-
TYPE_LOCATION
public static final int TYPE_LOCATION
Type value forLocationStepQueryNode- See Also:
- Constant Field Values
-
TYPE_PATH
public static final int TYPE_PATH
Type value forPathQueryNode- See Also:
- Constant Field Values
-
TYPE_DEREF
public static final int TYPE_DEREF
Type value forDerefQueryNode- See Also:
- Constant Field Values
-
TYPE_PROP_FUNCTION
public static final int TYPE_PROP_FUNCTION
Type value forPropertyFunctionQueryNode- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QueryNode
public QueryNode(QueryNode parent)
Constructs a newQueryNodewith a reference to it's parent.- Parameters:
parent- the parent node, ornullif this is the root node of a query tree.
-
-
Method Detail
-
getParent
public QueryNode getParent()
Returns the parentQueryNodeornullif this is the root node of a query tree.- Returns:
- the parent
QueryNodeornullif this is the root node of a query tree.
-
dump
public String dump() throws RepositoryException
Dumps this QueryNode and its child nodes to a String.- Returns:
- the query tree as a String.
- Throws:
RepositoryException
-
accept
public abstract Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException
Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.- 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 abstract int getType()
Returns the type of this query node.- Returns:
- the type of this query node.
-
equals
public abstract boolean equals(Object obj)
Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.
-
needsSystemTree
public abstract boolean needsSystemTree()
Returnstrueif this query node needs items under /jcr:system to be queried.- Returns:
trueif this query node needs content under /jcr:system to be queried;falseotherwise.
-
-