Class QueryNode
java.lang.Object
org.apache.jackrabbit.spi.commons.query.QueryNode
- Direct Known Subclasses:
ExactQueryNode
,NAryQueryNode
,OrderQueryNode
,PropertyFunctionQueryNode
,QueryRootNode
,TextsearchQueryNode
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
FieldsModifier and TypeFieldDescriptionstatic final int
Type value forAndQueryNode
static final int
Type value forDerefQueryNode
static final int
Type value forExactQueryNode
static final int
Type value forLocationStepQueryNode
static final int
Type value forNodeTypeQueryNode
static final int
Type value forNotQueryNode
static final int
Type value forOrQueryNode
static final int
Type value forOrderQueryNode
static final int
Type value forPathQueryNode
static final int
Type value forPropertyFunctionQueryNode
static final int
Type value forRelationQueryNode
static final int
Type value forQueryRootNode
static final int
Type value forTextsearchQueryNode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
accept
(QueryNodeVisitor visitor, Object data) Accepts aQueryNodeVisitor
and calls the appropriatevisit
method on the visitor depending on the concrete implementation of thisQueryNode
.dump()
Dumps this QueryNode and its child nodes to a String.abstract boolean
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node.Returns the parentQueryNode
ornull
if this is the root node of a query tree.abstract int
getType()
Returns the type of this query node.abstract boolean
Returnstrue
if this query node needs items under /jcr:system to be queried.
-
Field Details
-
TYPE_ROOT
public static final int TYPE_ROOTType value forQueryRootNode
- See Also:
-
TYPE_RELATION
public static final int TYPE_RELATIONType value forRelationQueryNode
- See Also:
-
TYPE_ORDER
public static final int TYPE_ORDERType value forOrderQueryNode
- See Also:
-
TYPE_TEXTSEARCH
public static final int TYPE_TEXTSEARCHType value forTextsearchQueryNode
- See Also:
-
TYPE_EXACT
public static final int TYPE_EXACTType value forExactQueryNode
- See Also:
-
TYPE_NODETYPE
public static final int TYPE_NODETYPEType value forNodeTypeQueryNode
- See Also:
-
TYPE_AND
public static final int TYPE_ANDType value forAndQueryNode
- See Also:
-
TYPE_OR
public static final int TYPE_ORType value forOrQueryNode
- See Also:
-
TYPE_NOT
public static final int TYPE_NOTType value forNotQueryNode
- See Also:
-
TYPE_LOCATION
public static final int TYPE_LOCATIONType value forLocationStepQueryNode
- See Also:
-
TYPE_PATH
public static final int TYPE_PATHType value forPathQueryNode
- See Also:
-
TYPE_DEREF
public static final int TYPE_DEREFType value forDerefQueryNode
- See Also:
-
TYPE_PROP_FUNCTION
public static final int TYPE_PROP_FUNCTIONType value forPropertyFunctionQueryNode
- See Also:
-
-
Constructor Details
-
QueryNode
Constructs a newQueryNode
with a reference to it's parent.- Parameters:
parent
- the parent node, ornull
if this is the root node of a query tree.
-
-
Method Details
-
getParent
Returns the parentQueryNode
ornull
if this is the root node of a query tree.- Returns:
- the parent
QueryNode
ornull
if this is the root node of a query tree.
-
dump
Dumps this QueryNode and its child nodes to a String.- Returns:
- the query tree as a String.
- Throws:
RepositoryException
-
accept
Accepts aQueryNodeVisitor
and calls the appropriatevisit
method 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
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node. -
needsSystemTree
public abstract boolean needsSystemTree()Returnstrue
if this query node needs items under /jcr:system to be queried.- Returns:
true
if this query node needs content under /jcr:system to be queried;false
otherwise.
-