public class SimpleFilterProvider extends FilterProvider implements java.io.Serializable
FilterProvider
implementation that just stores
direct id-to-filter mapping.
Note that version 2.3 was a partial rewrite, now that
PropertyFilter
is set to replace BeanPropertyFilter
.
Constructor and Description |
---|
SimpleFilterProvider() |
SimpleFilterProvider(java.util.Map<java.lang.String,?> mapping) |
public SimpleFilterProvider()
public SimpleFilterProvider(java.util.Map<java.lang.String,?> mapping)
mapping
- Mapping from id to filter; used as is if if possible@Deprecated public SimpleFilterProvider setDefaultFilter(BeanPropertyFilter f)
PropertyFilter
instead of BeanPropertyFilter
f
- Filter to return when no filter is found for given idpublic SimpleFilterProvider setDefaultFilter(PropertyFilter f)
public SimpleFilterProvider setDefaultFilter(SimpleBeanPropertyFilter f)
SimpleBeanPropertyFilter
.public PropertyFilter getDefaultFilter()
public SimpleFilterProvider setFailOnUnknownId(boolean state)
public boolean willFailOnUnknownId()
@Deprecated public SimpleFilterProvider addFilter(java.lang.String id, BeanPropertyFilter filter)
public SimpleFilterProvider addFilter(java.lang.String id, PropertyFilter filter)
public SimpleFilterProvider addFilter(java.lang.String id, SimpleBeanPropertyFilter filter)
SimpleBeanPropertyFilter
.public PropertyFilter removeFilter(java.lang.String id)
@Deprecated public BeanPropertyFilter findFilter(java.lang.Object filterId)
FilterProvider
BeanPropertyFilter
that has specified id.
Note that id is typically a String
, but is not necessarily
limited to that; that is, while standard components use String, custom
implementation can choose other kinds of keys.findFilter
in class FilterProvider
public PropertyFilter findPropertyFilter(java.lang.Object filterId, java.lang.Object valueToFilter)
FilterProvider
PropertyFilter
that has specified id.
Note that id is typically a String
, but is not necessarily
limited to that; that is, while standard components use String, custom
implementation can choose other kinds of keys.
This method is the replacement for FilterProvider.findFilter(java.lang.Object)
starting with 2.3.
Note that the default implementation is designed to support short-term
backwards compatibility, and will call the deprecated findFilter
method, then wrap filter if one found as PropertyFilter
.
It should be overridden by up-to-date implementations
findPropertyFilter
in class FilterProvider
filterId
- Id of the filter to fetchvalueToFilter
- Object being filtered (usually POJO, but may be a Map
,
or in future a container), if available; not available when generating
schemas.Copyright © 2010 - 2020 Adobe. All Rights Reserved