Class AbstractFilter
- java.lang.Object
-
- org.apache.sling.scripting.sightly.impl.filter.AbstractFilter
-
- All Implemented Interfaces:
Comparable<Filter>
,Filter
- Direct Known Subclasses:
FormatFilter
,I18nFilter
,JoinFilter
,URIManipulationFilter
,XSSFilter
public abstract class AbstractFilter extends Object implements Filter
-
-
Field Summary
Fields Modifier and Type Field Description static Set<ExpressionContext>
NON_PARAMETRIZABLE_CONTEXTS
protected int
priority
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Expression
apply(Expression expression, Map<String,ExpressionNode> options)
Expression
apply(Expression expression, ExpressionContext expressionContext)
Transform the given expressionint
compareTo(Filter o)
boolean
equals(Object obj)
Set<ExpressionContext>
getApplicableContexts()
Provides the applicable contexts for this filter.Set<String>
getOptions()
Provides the option names thisFilter
will process.Set<String>
getRequiredOptions()
Provides the option names that will trigger a filter's execution.int
hashCode()
int
priority()
The priority with which filters are applied.
-
-
-
Field Detail
-
priority
protected int priority
-
NON_PARAMETRIZABLE_CONTEXTS
public static final Set<ExpressionContext> NON_PARAMETRIZABLE_CONTEXTS
-
-
Method Detail
-
priority
public int priority()
Description copied from interface:Filter
The priority with which filters are applied. This establishes order between filters. Filters with lower priority are applied first.
-
compareTo
public int compareTo(Filter o)
- Specified by:
compareTo
in interfaceComparable<Filter>
-
apply
public Expression apply(Expression expression, ExpressionContext expressionContext)
Description copied from interface:Filter
Transform the given expression
-
apply
protected abstract Expression apply(Expression expression, Map<String,ExpressionNode> options)
-
getOptions
public Set<String> getOptions()
Description copied from interface:Filter
Provides the option names thisFilter
will process.- Specified by:
getOptions
in interfaceFilter
- Returns:
- a set of option names
-
getRequiredOptions
public Set<String> getRequiredOptions()
Description copied from interface:Filter
Provides the option names that will trigger a filter's execution.- Specified by:
getRequiredOptions
in interfaceFilter
- Returns:
- the required options from an expression in order to trigger the filter
-
getApplicableContexts
public Set<ExpressionContext> getApplicableContexts()
Description copied from interface:Filter
Provides the applicable contexts for this filter.- Specified by:
getApplicableContexts
in interfaceFilter
- Returns:
- the applicable contexts for this filter
-
-