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 intType value forAndQueryNodestatic final intType value forDerefQueryNodestatic final intType value forExactQueryNodestatic final intType value forLocationStepQueryNodestatic final intType value forNodeTypeQueryNodestatic final intType value forNotQueryNodestatic final intType value forOrQueryNodestatic final intType value forOrderQueryNodestatic final intType value forPathQueryNodestatic final intType value forPropertyFunctionQueryNodestatic final intType value forRelationQueryNodestatic final intType value forQueryRootNodestatic final intType value forTextsearchQueryNode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectaccept(QueryNodeVisitor visitor, Object data) Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.dump()Dumps this QueryNode and its child nodes to a String.abstract booleanReturnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.Returns the parentQueryNodeornullif this is the root node of a query tree.abstract intgetType()Returns the type of this query node.abstract booleanReturnstrueif 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 newQueryNodewith a reference to it's parent.- Parameters:
parent- the parent node, ornullif this is the root node of a query tree.
-
-
Method Details
-
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
Dumps this QueryNode and its child nodes to a String.- Returns:
- the query tree as a String.
- Throws:
RepositoryException
-
accept
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
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.
-