Class SimpleFilterProvider


  • public class SimpleFilterProvider
    extends FilterProvider
    Simple FilterProvider implementation that just stores direct id-to-filter mapping.
    • Field Detail

      • _filtersById

        protected final java.util.Map<java.lang.String,​BeanPropertyFilter> _filtersById
        Mappings from ids to filters.
      • _defaultFilter

        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.
      • _cfgFailOnUnknownId

        protected boolean _cfgFailOnUnknownId
        Flag that indicates whether request for an unknown filter id should result an exception (default) or not. Note that this is only relevant if no default filter has been configured.
        Since:
        1.9
    • Constructor Detail

      • SimpleFilterProvider

        public SimpleFilterProvider()
      • SimpleFilterProvider

        public SimpleFilterProvider​(java.util.Map<java.lang.String,​BeanPropertyFilter> mapping)
        Parameters:
        mapping - Mapping from id to filter; used as is, no copy is made.
    • Method Detail

      • setDefaultFilter

        public 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.
        Parameters:
        f - Filter to return when no filter is found for given id
      • willFailOnUnknownId

        public boolean willFailOnUnknownId()
        Since:
        1.9
      • findFilter

        public BeanPropertyFilter findFilter​(java.lang.Object filterId)
        Description copied from class: FilterProvider
        Lookup method used to find 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.
        Specified by:
        findFilter in class FilterProvider
        Returns:
        Filter registered with specified id, if one defined; null if none found.