Class Sort

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class Sort
    extends Object
    implements Serializable, Cloneable

    The cf:sort element 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:sort element 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:sort element 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:sort element refers to the default sort order.
    • label - this attribute contains a human-readable name for the property to which this cf:sort element 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:sort element 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:sort element 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
    • Constructor Detail

      • Sort

        public Sort​(org.jdom2.Namespace namespace,
                    String element,
                    String dataType,
                    String label,
                    boolean defaultOrder)
        Parameters:
        namespace - Namespace of the element
        element - Name of the element
        dataType - data-type of the element
        label - Label for the sort
        defaultOrder - 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object