Interface Filter
- All Superinterfaces:
Comparable<Filter>
- All Known Implementing Classes:
AbstractFilter,FormatFilter,I18nFilter,JoinFilter,URIManipulationFilter,XSSFilter
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
Modifier and TypeMethodDescriptionapply(Expression expression, ExpressionContext expressionContext) Transform the given expressiondefault Set<ExpressionContext>Provides the applicable contexts for this filter.Provides the option names thisFilterwill process.Provides the option names that will trigger a filter's execution.intpriority()The priority with which filters are applied.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
apply
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
Provides the option names thisFilterwill process.- Returns:
- a set of option names
-
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
Provides the applicable contexts for this filter.- Returns:
- the applicable contexts for this filter
-