类 MutableSortDefinition
- java.lang.Object
- org.springframework.beans.support.MutableSortDefinition
- 所有已实现的接口:
Serializable
,SortDefinition
public class MutableSortDefinition extends Object implements SortDefinition, Serializable
Mutable implementation of theSortDefinition
interface. Supports toggling the ascending value on setting the same property again.- 从以下版本开始:
- 26.05.2003
- 作者:
- Juergen Hoeller, Jean-Pierre Pawlak
- 另请参阅:
setToggleAscendingOnProperty(boolean)
, 序列化表格
构造器概要
构造器 构造器 说明 MutableSortDefinition()
Create an empty MutableSortDefinition, to be populated via its bean properties.MutableSortDefinition(boolean toggleAscendingOnSameProperty)
Create a new MutableSortDefinition.MutableSortDefinition(String property, boolean ignoreCase, boolean ascending)
Create a MutableSortDefinition for the given settings.MutableSortDefinition(SortDefinition source)
Copy constructor: create a new MutableSortDefinition that mirrors the given sort definition.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
equals(Object other)
String
getProperty()
Return the name of the bean property to compare.int
hashCode()
boolean
isAscending()
Return whether to sort ascending (true) or descending (false).boolean
isIgnoreCase()
Return whether upper and lower case in String values should be ignored.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).void
setAscending(boolean ascending)
Set whether to sort ascending (true) or descending (false).void
setIgnoreCase(boolean ignoreCase)
Set whether upper and lower case in String values should be ignored.void
setProperty(String property)
Set the property to compare.void
setToggleAscendingOnProperty(boolean toggleAscendingOnProperty)
Set whether to toggle the ascending flag if the same property gets set again (that is,setProperty(java.lang.String)
gets called with already set property name again).
构造器详细资料
MutableSortDefinition
public MutableSortDefinition()
Create an empty MutableSortDefinition, to be populated via its bean properties.
MutableSortDefinition
public MutableSortDefinition(SortDefinition source)
Copy constructor: create a new MutableSortDefinition that mirrors the given sort definition.- 参数:
source
- the original sort definition
MutableSortDefinition
public MutableSortDefinition(String property, boolean ignoreCase, boolean ascending)
Create a MutableSortDefinition for the given settings.- 参数:
property
- the property to compareignoreCase
- whether upper and lower case in String values should be ignoredascending
- whether to sort ascending (true) or descending (false)
MutableSortDefinition
public MutableSortDefinition(boolean toggleAscendingOnSameProperty)
Create a new MutableSortDefinition.- 参数:
toggleAscendingOnSameProperty
- whether to toggle the ascending flag if the same property gets set again (that is,setProperty
gets called with already set property name again).
方法详细资料
setProperty
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.
getProperty
public String getProperty()
从接口复制的说明:SortDefinition
Return the name of the bean property to compare. Can also be a nested bean property path.- 指定者:
getProperty
在接口中SortDefinition
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase)
Set whether upper and lower case in String values should be ignored.
isIgnoreCase
public boolean isIgnoreCase()
从接口复制的说明:SortDefinition
Return whether upper and lower case in String values should be ignored.- 指定者:
isIgnoreCase
在接口中SortDefinition
setAscending
public void setAscending(boolean ascending)
Set whether to sort ascending (true) or descending (false).
isAscending
public boolean isAscending()
从接口复制的说明:SortDefinition
Return whether to sort ascending (true) or descending (false).- 指定者:
isAscending
在接口中SortDefinition
setToggleAscendingOnProperty
public void setToggleAscendingOnProperty(boolean toggleAscendingOnProperty)
Set whether to toggle the ascending flag if the same property gets set again (that is,setProperty(java.lang.String)
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.
isToggleAscendingOnProperty
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).