Package org.czeal.jsonfilter
Class FilterFactory
java.lang.Object
org.czeal.jsonfilter.FilterFactory
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 -
Method Summary
Modifier and TypeMethodDescriptioncreate
(FilterType type) Creates a filter based on the given filter type.
-
Constructor Details
-
FilterFactory
public FilterFactory()
-
-
Method Details
-
create
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.
-