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_CONTEXTSprotected intpriority
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Expressionapply(Expression expression, Map<String,ExpressionNode> options)Expressionapply(Expression expression, ExpressionContext expressionContext)Transform the given expressionintcompareTo(Filter o)booleanequals(Object obj)Set<ExpressionContext>getApplicableContexts()Provides the applicable contexts for this filter.Set<String>getOptions()Provides the option names thisFilterwill process.Set<String>getRequiredOptions()Provides the option names that will trigger a filter's execution.inthashCode()intpriority()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:FilterThe 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:
compareToin interfaceComparable<Filter>
-
apply
public Expression apply(Expression expression, ExpressionContext expressionContext)
Description copied from interface:FilterTransform the given expression
-
apply
protected abstract Expression apply(Expression expression, Map<String,ExpressionNode> options)
-
getOptions
public Set<String> getOptions()
Description copied from interface:FilterProvides the option names thisFilterwill process.- Specified by:
getOptionsin interfaceFilter- Returns:
- a set of option names
-
getRequiredOptions
public Set<String> getRequiredOptions()
Description copied from interface:FilterProvides the option names that will trigger a filter's execution.- Specified by:
getRequiredOptionsin interfaceFilter- Returns:
- the required options from an expression in order to trigger the filter
-
getApplicableContexts
public Set<ExpressionContext> getApplicableContexts()
Description copied from interface:FilterProvides the applicable contexts for this filter.- Specified by:
getApplicableContextsin interfaceFilter- Returns:
- the applicable contexts for this filter
-
-