|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.content.expression.SortCriteria
public class SortCriteria
A class which handles the sortBy part of a Search.
This object represents a single sort criteria, which is a property name and an ascending/descending flag. The class provides a utility method to parse a sortBy string into an array of SortCriteria.
This supports standard SQL-style sort by clauses of the form:
<propname>[ASC|DESC], ...
where ASC|DESC is optional, defaulting to ASC; also, if propname contains a
".", it assumed to be <properyset>.<propname>. Additionally,
if the property name contains non-identifier characters
(e.g. whitespace, double quotes, dashes, etc.), you can use the
toProperty('propname')
or
toProperty('propertyset', 'propname')
Examples of valid sortBy clauses:
Field Summary | |
---|---|
boolean |
isAscending
The ascending or descending order. |
String |
propertyName
The property name to sort on. |
String |
propertySet
The property set name. |
Constructor Summary | |
---|---|
SortCriteria(String propertyName)
Constructor. |
|
SortCriteria(String propertyName,
boolean isAscending)
Constructor. |
|
SortCriteria(String propertySet,
String propertyName,
boolean isAscending)
Deprecated The property set is no longer being used in SortCriteria |
Method Summary | |
---|---|
Object |
clone()
Clone this object. |
int |
compareTo(Object obj)
Compare this object to another object. |
boolean |
equals(Object o)
Determine if this object is equal to another object. |
static SortCriteria[] |
getSortCriteria(String sortBy)
Parse the given sort string and return an array of SortCriteria. |
int |
hashCode()
Override the hashCode because we override equals(). |
String |
toString()
Convert to a string. |
static String |
toString(SortCriteria[] sort)
Convert an array of sort criteria to a sort clause. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String propertySet
public String propertyName
public boolean isAscending
Constructor Detail |
---|
@Deprecated public SortCriteria(String propertySet, String propertyName, boolean isAscending)
propertySet
- The property set to sort on. No longer used.propertyName
- The property name to sort on.isAscending
- True if this should sort ascending. Defaults to true.public SortCriteria(String propertyName, boolean isAscending)
propertyName
- The property name to sort on.isAscending
- True if this should sort ascending. Defaults to true.public SortCriteria(String propertyName)
propertyName
- The property name to sort on.Method Detail |
---|
public Object clone()
clone
in class Object
public int compareTo(Object obj)
compareTo
in interface Comparable
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static SortCriteria[] getSortCriteria(String sortBy) throws IllegalArgumentException
sortBy
- the sort string (e.g. "identifier ASC, creationDate
DESC").
IllegalArgumentException
- thrown on an invalid sortBy string.public String toString()
toString
in class Object
public static String toString(SortCriteria[] sort)
This will return a sort clause that, if parsed, will return the equivalent SortCriteria objects as those passed. It will not, however, neccessarily be the same sort clause that might have generated the incoming SortCriteria.
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |