Package com.rometools.modules.sle.types
Class Sort
- java.lang.Object
-
- com.rometools.modules.sle.types.Sort
-
- All Implemented Interfaces:
Serializable,Cloneable
public class Sort extends Object implements Serializable, Cloneable
The
cf:sortelement is intended to inform the client that the property to which it refers is one that is “sortable” – that is, that the client should provide a user interface that allows the user to sort on that property.The
cf:sortelement can also be used to provide a label for the default sort that appears in the list (in this case, only the label attribute should be included).The
cf:sortelement contains the following attributes:- ns - this attribute is the full namespace used in the property element. If the attribute value is an empty string, it is assumed that the property does not live in a namespace. If the ns attribute is omitted, the default value is the empty string. In the example above, the ns attribute would contain "http://www.example.com/book". It would not contain the namespace prefix.
- element - this attribute is the name of the property (without any namespace). In the
example above, the element attribute would contain "firstedition" If this attribute is omitted,
it is assumed that the label attribute is included and that this
cf:sortelement refers to the default sort order. - label - this attribute contains a human-readable name for the property to which this
cf:sortelement refers. If it is omitted, the client should use the value of the "element" attribute as the human-readable name. The "label" attribute is required if the "element" attribute is omitted. - data-type - this attribute informs the client about the data-type of the property to
which this
cf:sortelement refers.. It contains one of the following values: date, number, text. If it is omitted, the default value is text. - default - this attribute indicates whether the property to which this
cf:sortelement refers is the default sort order in the list. The allowed values are "true" and "false". If omitted, the default value is "false". The items in the list must be already be sorted by the element – this is, the client should not expect to have to resort by this field if it displaying content directly from the list. The client should respect only the first instance of default="true" that it encounters.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()booleanequals(Object o)StringgetDataType()Returns the dataType of the sortbooleangetDefaultOrder()Indicates this is the natural order of the feed.StringgetElement()Name of the element.StringgetLabel()User label for sorting.org.jdom2.NamespacegetNamespace()Namespace of the elementinthashCode()StringtoString()
-
-
-
Field Detail
-
DATE_TYPE
public static final String DATE_TYPE
dataType value for Date information.- See Also:
- Constant Field Values
-
TEXT_TYPE
public static final String TEXT_TYPE
dataType value for Text information- See Also:
- Constant Field Values
-
NUMBER_TYPE
public static final String NUMBER_TYPE
DataType value for Number information.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Sort
public Sort(org.jdom2.Namespace namespace, String element, String dataType, String label, boolean defaultOrder)- Parameters:
namespace- Namespace of the elementelement- Name of the elementdataType- data-type of the elementlabel- Label for the sortdefaultOrder- indicates if this is the defaul order of the feed.
-
-
Method Detail
-
getDataType
public String getDataType()
Returns the dataType of the sort- Returns:
- Returns the dataType of the sort
-
getDefaultOrder
public boolean getDefaultOrder()
Indicates this is the natural order of the feed.- Returns:
- Indicates this is the natural order of the feed.
-
getElement
public String getElement()
Name of the element.- Returns:
- Name of the element.
-
getLabel
public String getLabel()
User label for sorting.- Returns:
- User label for sorting.
-
getNamespace
public org.jdom2.Namespace getNamespace()
Namespace of the element- Returns:
- Namespace of the element
-
-