6
6
7
7
/**
8
8
* 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.
10
12
*<p>
11
13
* Note that version 2.3 was a partial rewrite, now that
12
14
* {@link PropertyFilter} is set to replace <code>BeanPropertyFilter</code>.
@@ -25,7 +27,7 @@ public class SimpleFilterProvider
25
27
26
28
/**
27
29
* 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
29
31
* reports an error), but can be set to an explicit filter.
30
32
*/
31
33
protected PropertyFilter _defaultFilter ;
@@ -104,6 +106,14 @@ public SimpleFilterProvider setDefaultFilter(BeanPropertyFilter f)
104
106
return this ;
105
107
}
106
108
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
+ */
107
117
public SimpleFilterProvider setDefaultFilter (PropertyFilter f )
108
118
{
109
119
_defaultFilter = f ;
@@ -170,7 +180,7 @@ public BeanPropertyFilter findFilter(Object filterId)
170
180
{
171
181
throw new UnsupportedOperationException ("Access to deprecated filters not supported" );
172
182
}
173
-
183
+
174
184
@ Override
175
185
public PropertyFilter findPropertyFilter (Object filterId , Object valueToFilter )
176
186
{
0 commit comments