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 and Type | Method and Description |
---|---|
java.lang.Object |
accept(QueryNodeVisitor visitor,
java.lang.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(java.lang.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(java.lang.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.
|
public int getType()
public void newOrderSpec()
public void setAscending(boolean value)
value
- true
for ascending and false
for
descending.java.lang.IllegalStateException
- if no order specification is setOrderQueryNode.OrderSpec.setAscending(boolean)
public void setPath(Path path)
path
- a pathjava.lang.IllegalStateException
- if no order specification is setOrderQueryNode.OrderSpec.setPath(org.apache.jackrabbit.spi.Path)
public void setFunction(java.lang.String name)
name
- a function namejava.lang.IllegalStateException
- 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 java.lang.Object accept(QueryNodeVisitor visitor, java.lang.Object data) throws RepositoryException
QueryNodeVisitor
and calls the appropriate visit
method on the visitor depending on the concrete implementation of
this QueryNode
.public boolean isAscending(int i) throws java.lang.IndexOutOfBoundsException
true
if the property i
should be ordered
ascending. If false
the property is ordered descending.i
- index of the propertyi
.java.lang.IndexOutOfBoundsException
- if there is no property with
index i
.public OrderQueryNode.OrderSpec[] getOrderSpecs()
OrderSpec
array that contains order by
specifications.public boolean equals(java.lang.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 © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"