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 java.lang.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 int
TYPE_AND
Type value forAndQueryNode
static int
TYPE_DEREF
Type value forDerefQueryNode
static int
TYPE_EXACT
Type value forExactQueryNode
static int
TYPE_LOCATION
Type value forLocationStepQueryNode
static int
TYPE_NODETYPE
Type value forNodeTypeQueryNode
static int
TYPE_NOT
Type value forNotQueryNode
static int
TYPE_OR
Type value forOrQueryNode
static int
TYPE_ORDER
Type value forOrderQueryNode
static int
TYPE_PATH
Type value forPathQueryNode
static int
TYPE_PROP_FUNCTION
Type value forPropertyFunctionQueryNode
static int
TYPE_RELATION
Type value forRelationQueryNode
static int
TYPE_ROOT
Type value forQueryRootNode
static int
TYPE_TEXTSEARCH
Type value forTextsearchQueryNode
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.Object
accept(QueryNodeVisitor visitor, java.lang.Object data)
Accepts aQueryNodeVisitor
and calls the appropriatevisit
method on the visitor depending on the concrete implementation of thisQueryNode
.java.lang.String
dump()
Dumps this QueryNode and its child nodes to a String.abstract boolean
equals(java.lang.Object obj)
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node.QueryNode
getParent()
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
needsSystemTree()
Returnstrue
if 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 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 Detail
-
getParent
public QueryNode 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
public java.lang.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 java.lang.Object accept(QueryNodeVisitor visitor, java.lang.Object data) throws RepositoryException
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
public abstract boolean equals(java.lang.Object obj)
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
ifobj
is equal tothis
;false
otherwise.
-
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.
-
-