Interface Container.Filter

All Superinterfaces:
All Known Implementing Classes:
AbstractJunctionFilter, And, Between, Compare, Compare.Equal, Compare.Greater, Compare.GreaterOrEqual, Compare.Less, Compare.LessOrEqual, IsNull, Like, Not, Or, SimpleStringFilter
Enclosing interface:

public static interface Container.Filter

Filter interface for container filtering. If a filter does not support in-memory filtering, #passesFilter(Item) should throw UnsupportedOperationException. Lazy containers must be able to map filters to their internal representation (e.g. SQL or JPA 2.0 Criteria). An UnsupportedFilterException can be thrown by the container if a particular filter is not supported by the container. An Container.Filter should implement #equals(Object) and #hashCode() correctly to avoid duplicate filter registrations etc.

See Also:

Method Summary
 boolean appliesToProperty(java.lang.Object propertyId)
          Check if a change in the value of a property can affect the filtering result.
 boolean passesFilter(java.lang.Object itemId, Item item)
          Check if an item passes the filter (in-memory filtering).

Method Detail


boolean passesFilter(java.lang.Object itemId,
                     Item item)
                     throws java.lang.UnsupportedOperationException
Check if an item passes the filter (in-memory filtering).

itemId - identifier of the item being filtered; may be null when the item is being added to the container
item - the item being filtered
true if the item is accepted by this filter
java.lang.UnsupportedOperationException - if the filter cannot be used for in-memory filtering


boolean appliesToProperty(java.lang.Object propertyId)
Check if a change in the value of a property can affect the filtering result. May always return true, at the cost of performance. If the filter cannot determine whether it may depend on the property or not, should return true.

propertyId -
true if the filtering result may/does change based on changes to the property identified by propertyId

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