Interface Filter
-
- All Superinterfaces:
Comparable<Filter>
- All Known Implementing Classes:
AbstractFilter
,FormatFilter
,I18nFilter
,JoinFilter
,URIManipulationFilter
,XSSFilter
public interface Filter extends Comparable<Filter>
A filter is a transformation which performs modifications on expressions. Unlike plugins, filters are always applied on an expression. Whether the filter transformation is actually necessary is decided by the filter. The application order of filters is given by filter priority.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Expression
apply(Expression expression, ExpressionContext expressionContext)
Transform the given expressiondefault Set<ExpressionContext>
getApplicableContexts()
Provides the applicable contexts for this filter.default Set<String>
getOptions()
Provides the option names thisFilter
will process.default Set<String>
getRequiredOptions()
Provides the option names that will trigger a filter's execution.int
priority()
The priority with which filters are applied.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
apply
Expression apply(Expression expression, ExpressionContext expressionContext)
Transform the given expression- Parameters:
expression
- the original expressionexpressionContext
- the expression's context- Returns:
- a transformed expression. If the filter is not applicable to the given expression, then the original expression shall be returned
-
priority
int priority()
The priority with which filters are applied. This establishes order between filters. Filters with lower priority are applied first.- Returns:
- an integer representing the filter's priority
-
getOptions
default Set<String> getOptions()
Provides the option names thisFilter
will process.- Returns:
- a set of option names
-
getRequiredOptions
default Set<String> getRequiredOptions()
Provides the option names that will trigger a filter's execution.- Returns:
- the required options from an expression in order to trigger the filter
-
getApplicableContexts
default Set<ExpressionContext> getApplicableContexts()
Provides the applicable contexts for this filter.- Returns:
- the applicable contexts for this filter
-
-