66
77/**
88 * Simple {@link FilterProvider} implementation that just stores
9- * direct id-to-filter mapping.
9+ * direct id-to-filter mapping. It also allows specifying a
10+ * "default" filter to return if no registered instance matches
11+ * given filter id.
1012 *<p>
1113 * Note that version 2.3 was a partial rewrite, now that
1214 * {@link PropertyFilter} is set to replace <code>BeanPropertyFilter</code>.
@@ -25,7 +27,7 @@ public class SimpleFilterProvider
2527
2628 /**
2729 * This is the filter we return in case no mapping was found for
28- * given id; default is ' null' (in which case caller typically
30+ * given id; default is {@code null} (in which case caller typically
2931 * reports an error), but can be set to an explicit filter.
3032 */
3133 protected PropertyFilter _defaultFilter ;
@@ -104,6 +106,14 @@ public SimpleFilterProvider setDefaultFilter(BeanPropertyFilter f)
104106 return this ;
105107 }
106108
109+ /**
110+ * Method for defining "default filter" to use, if any ({@code null} if none),
111+ * to return in case no registered instance matches passed filter id.
112+ *
113+ * @param f Default filter to set
114+ *
115+ * @return This provider instance, for call-chaining
116+ */
107117 public SimpleFilterProvider setDefaultFilter (PropertyFilter f )
108118 {
109119 _defaultFilter = f ;
@@ -170,7 +180,7 @@ public BeanPropertyFilter findFilter(Object filterId)
170180 {
171181 throw new UnsupportedOperationException ("Access to deprecated filters not supported" );
172182 }
173-
183+
174184 @ Override
175185 public PropertyFilter findPropertyFilter (Object filterId , Object valueToFilter )
176186 {
0 commit comments