Package org.czeal.jsonfilter
Class FilterFactory
- java.lang.Object
-
- org.czeal.jsonfilter.FilterFactory
-
public class FilterFactory extends Object
A factory class for creating filtering strategy implementations.This factory provides instances of filters that can either include or exclude specified JSON elements based on a given filtering strategy.
Supported filtering strategies:
INCLUSION- Retains only the specified JSON elements.EXCLUSION- Removes the specified JSON elements.
Usage example:
FilterFactory factory = new FilterFactory(); Filter filter = factory.create(FilterType.INCLUSION);- Author:
- Hideki Ikeda
-
-
Constructor Summary
Constructors Constructor Description FilterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Filtercreate(FilterType type)Creates a filter based on the given filter type.
-
-
-
Method Detail
-
create
public Filter create(FilterType type)
Creates a filter based on the given filter type.- Parameters:
type- The filter type.- Returns:
- A filter implementation.
- Throws:
NullPointerException- If the filter type isnull.IllegalArgumentException- If the filter type is unknown.
-
-