com.vaadin.data.util.
Class PropertyValueGenerator<T>
- java.lang.Object
-
- com.vaadin.data.util.PropertyValueGenerator<T>
-
Type Parameters:
T
- Property data typeAll Implemented Interfaces:
public abstract class PropertyValueGenerator<T> extends Object implements Serializable
PropertyValueGenerator for GeneratedPropertyContainer.
Since:
7.4
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description PropertyValueGenerator()
-
Method Summary
All Methods Modifier and Type Method Description SortOrder[]
getSortProperties(SortOrder order)
Translates sorting of the generated property in a specific direction to a set of property ids and directions in the underlying container.
abstract Class<T>
getType()
Return Property type for this generator.
abstract T
getValue(Item item, Object itemId, Object propertyId)
Returns value for given Item.
Container.Filter
modifyFilter(Container.Filter filter)
Return an updated filter that should be compatible with the underlying container.
-
-
-
Method Detail
-
getValue
public abstract T getValue(Item item, Object itemId, Object propertyId)
Returns value for given Item. Used by GeneratedPropertyContainer when generating new properties.
Parameters:
item
- currently handled itemitemId
- item id for currently handled itempropertyId
- id for this propertyReturns:
generated value
-
getType
public abstract Class<T> getType()
Return Property type for this generator. This function is called when
Property.getType()
is called for generated property.Returns:
type of generated property
-
getSortProperties
public SortOrder[] getSortProperties(SortOrder order)
Translates sorting of the generated property in a specific direction to a set of property ids and directions in the underlying container.
SortOrder is similar to (or the same as) the SortOrder already defined for Grid.
The default implementation of this method returns an empty array, which means that the property will not be included in getSortableContainerPropertyIds(). Attempting to sort by that column throws UnsupportedOperationException. Returning null is not allowed.
Parameters:
order
- a sort order for this propertyReturns:
an array of sort orders describing how this property is sorted
-
modifyFilter
public Container.Filter modifyFilter(Container.Filter filter) throws UnsupportedFilterException
Return an updated filter that should be compatible with the underlying container.
This function is called when setting a filter for this generated property. Returning null from this function causes GeneratedPropertyContainer to discard the filter and not use it.
By default this function throws UnsupportedFilterException.
Parameters:
filter
- original filter for this propertyReturns:
modified filter that is compatible with the underlying container
Throws:
UnsupportedFilterException
- if the implementation doesn't support modifying the provided filter
-
-