com.vaadin.data.util
Class PropertyValueGenerator<T>

java.lang.Object
  extended by com.vaadin.data.util.PropertyValueGenerator<T>
Type Parameters:
T - Property data type
All Implemented Interfaces:
java.io.Serializable

public abstract class PropertyValueGenerator<T>
extends java.lang.Object
implements java.io.Serializable

PropertyValueGenerator for GeneratedPropertyContainer.

Since:
7.4
Author:
Vaadin Ltd
See Also:
Serialized Form

Constructor Summary
PropertyValueGenerator()
           
 
Method Summary
 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  java.lang.Class<T> getType()
          Return Property type for this generator.
abstract  T getValue(Item item, java.lang.Object itemId, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyValueGenerator

public PropertyValueGenerator()
Method Detail

getValue

public abstract T getValue(Item item,
                           java.lang.Object itemId,
                           java.lang.Object propertyId)
Returns value for given Item. Used by GeneratedPropertyContainer when generating new properties.

Parameters:
item - currently handled item
itemId - item id for currently handled item
propertyId - id for this property
Returns:
generated value

getType

public abstract java.lang.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 property
Returns:
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 property
Returns:
modified filter that is compatible with the underlying container
Throws:
UnsupportedFilterException


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.