|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.databind.ser.FilterProvider com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider
public class SimpleFilterProvider
Simple FilterProvider
implementation that just stores
direct id-to-filter mapping.
Field Summary | |
---|---|
protected boolean |
_cfgFailOnUnknownId
Flag that indicates whether request for an unknown filter id should result an exception (default) or not. |
protected BeanPropertyFilter |
_defaultFilter
This is the filter we return in case no mapping was found for given id; default is 'null' (in which case caller typically reports an error), but can be set to an explicit filter. |
protected Map<String,BeanPropertyFilter> |
_filtersById
Mappings from ids to filters. |
Constructor Summary | |
---|---|
SimpleFilterProvider()
|
|
SimpleFilterProvider(Map<String,BeanPropertyFilter> mapping)
|
Method Summary | |
---|---|
SimpleFilterProvider |
addFilter(String id,
BeanPropertyFilter filter)
|
BeanPropertyFilter |
findFilter(Object filterId)
Lookup method used to find BeanPropertyFilter that has specified id. |
BeanPropertyFilter |
getDefaultFilter()
|
BeanPropertyFilter |
removeFilter(String id)
|
SimpleFilterProvider |
setDefaultFilter(BeanPropertyFilter f)
Method for defining filter to return for "unknown" filters; cases where there is no mapping from given id to an explicit filter. |
SimpleFilterProvider |
setFailOnUnknownId(boolean state)
|
boolean |
willFailOnUnknownId()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Map<String,BeanPropertyFilter> _filtersById
protected BeanPropertyFilter _defaultFilter
protected boolean _cfgFailOnUnknownId
Constructor Detail |
---|
public SimpleFilterProvider()
public SimpleFilterProvider(Map<String,BeanPropertyFilter> mapping)
mapping
- Mapping from id to filter; used as is, no copy is made.Method Detail |
---|
public SimpleFilterProvider setDefaultFilter(BeanPropertyFilter f)
f
- Filter to return when no filter is found for given idpublic BeanPropertyFilter getDefaultFilter()
public SimpleFilterProvider setFailOnUnknownId(boolean state)
public boolean willFailOnUnknownId()
public SimpleFilterProvider addFilter(String id, BeanPropertyFilter filter)
public BeanPropertyFilter removeFilter(String id)
public BeanPropertyFilter findFilter(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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |