public class OrderQueryNode extends QueryNode
Modifier and Type | Class and Description |
---|---|
static class |
OrderQueryNode.OrderSpec
Implements a single order specification.
|
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
Modifier | Constructor and Description |
---|---|
protected |
OrderQueryNode(QueryNode parent)
Creates a new
OrderQueryNode with a reference to a parent
node and sort properties. |
Modifier and Type | Method and Description |
---|---|
Object |
accept(QueryNodeVisitor visitor,
Object data)
Accepts a
QueryNodeVisitor and calls the appropriate visit
method on the visitor depending on the concrete implementation of
this QueryNode . |
void |
addOrderSpec(Name property,
boolean ascending)
Deprecated.
use
addOrderSpec(Path , boolean) instead. |
void |
addOrderSpec(OrderQueryNode.OrderSpec spec)
Adds an order specification to this query node.
|
void |
addOrderSpec(Path property,
boolean ascending)
Adds an order specification to this query node.
|
boolean |
equals(Object obj)
Returns
true if obj is the same type of
QueryNode as this node and is equal to
this node. |
OrderQueryNode.OrderSpec[] |
getOrderSpecs()
Returns a
OrderSpec array that contains order by
specifications. |
int |
getType()
Returns the type of this node.
|
boolean |
isAscending(int i)
Returns
true if the property i should be ordered
ascending. |
boolean |
isValid()
Checks whether all order specifications of this query node have at least
its path specified (i.e.
|
boolean |
needsSystemTree()
Returns
true if this query node needs items under
/jcr:system to be queried. |
void |
newOrderSpec()
Create and add a new (empty) order specification to this query node.
|
void |
setAscending(boolean value)
Set the last order specification of this query node to ascending/descending
|
void |
setFunction(String name)
Set the function of the last order specification of this query node.
|
void |
setPath(Path path)
Set the path of the last order specification of this query node.
|
protected OrderQueryNode(QueryNode parent)
OrderQueryNode
with a reference to a parent
node and sort properties.parent
- the parent node of this query node.public int getType()
public void newOrderSpec()
public void setAscending(boolean value)
value
- true
for ascending and false
for
descending.IllegalStateException
- if no order specification is setOrderQueryNode.OrderSpec.setAscending(boolean)
public void setPath(Path path)
path
- a pathIllegalStateException
- if no order specification is setOrderQueryNode.OrderSpec.setPath(org.apache.jackrabbit.spi.Path)
public void setFunction(String name)
name
- a function nameIllegalStateException
- if no order specification is setOrderQueryNode.OrderSpec.setFunction(String)
public boolean isValid()
null
.)true
iff all order specification of this query node are valid.public void addOrderSpec(Name property, boolean ascending)
addOrderSpec(Path , boolean)
instead.property
- the name of the property.ascending
- if true
values of this properties are
ordered ascending; descending if false
.public void addOrderSpec(Path property, boolean ascending)
property
- the relative path of the property.ascending
- if true
values of this properties are
ordered ascending; descending if false
.public void addOrderSpec(OrderQueryNode.OrderSpec spec)
spec
- the order spec.public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException
QueryNodeVisitor
and calls the appropriate visit
method on the visitor depending on the concrete implementation of
this QueryNode
.accept
in class QueryNode
visitor
- the visitor to call back.data
- arbitrary data for the visitor.visitor.visit()
call.RepositoryException
public boolean isAscending(int i) throws IndexOutOfBoundsException
true
if the property i
should be ordered
ascending. If false
the property is ordered descending.i
- index of the propertyi
.IndexOutOfBoundsException
- if there is no property with
index i
.public OrderQueryNode.OrderSpec[] getOrderSpecs()
OrderSpec
array that contains order by
specifications.public boolean equals(Object obj)
true
if obj
is the same type of
QueryNode
as this
node and is equal to
this
node.public boolean needsSystemTree()
true
if this query node needs items under
/jcr:system to be queried.needsSystemTree
in class QueryNode
true
if this query node needs content under
/jcr:system to be queried; false
otherwise.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.