Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » beans » support » [javadoc | source]
org.springframework.beans.support
public class: MutableSortDefinition [javadoc | source]
java.lang.Object
   org.springframework.beans.support.MutableSortDefinition

All Implemented Interfaces:
    SortDefinition, Serializable

Mutable implementation of the SortDefinition interface. Supports toggling the ascending value on setting the same property again.
Constructor:
 public MutableSortDefinition() 
 public MutableSortDefinition(SortDefinition source) 
    Copy constructor: create a new MutableSortDefinition that mirrors the given sort definition.
    Parameters:
    source - the original sort definition
 public MutableSortDefinition(boolean toggleAscendingOnSameProperty) 
 public MutableSortDefinition(String property,
    boolean ignoreCase,
    boolean ascending) 
    Create a MutableSortDefinition for the given settings.
    Parameters:
    property - the property to compare
    ignoreCase - whether upper and lower case in String values should be ignored
    ascending - whether to sort ascending (true) or descending (false)
Method from org.springframework.beans.support.MutableSortDefinition Summary:
equals,   getProperty,   hashCode,   isAscending,   isIgnoreCase,   isToggleAscendingOnProperty,   setAscending,   setIgnoreCase,   setProperty,   setToggleAscendingOnProperty
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.beans.support.MutableSortDefinition Detail:
 public boolean equals(Object other) 
 public String getProperty() 
 public int hashCode() 
 public boolean isAscending() 
 public boolean isIgnoreCase() 
 public boolean isToggleAscendingOnProperty() 
    Return whether to toggle the ascending flag if the same property gets set again (that is, #setProperty gets called with already set property name again).
 public  void setAscending(boolean ascending) 
    Set whether to sort ascending (true) or descending (false).
 public  void setIgnoreCase(boolean ignoreCase) 
    Set whether upper and lower case in String values should be ignored.
 public  void setProperty(String property) 
    Set the property to compare.

    If the property was the same as the current, the sort is reversed if "toggleAscendingOnProperty" is activated, else simply ignored.

 public  void setToggleAscendingOnProperty(boolean toggleAscendingOnProperty) 
    Set whether to toggle the ascending flag if the same property gets set again (that is, #setProperty gets called with already set property name again).

    This is particularly useful for parameter binding through a web request, where clicking on the field header again might be supposed to trigger a resort for the same field but opposite order.