public abstract class Filter extends LValue
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
name
The name of the filter.
|
BREAK, CONTINUE, rubyDateTimeFormat| Modifier | Constructor and Description |
|---|---|
protected |
Filter()
Used for all package protected filters in the liqp.filters-package
whose name is their class name lower cased.
|
|
Filter(java.lang.String name)
Creates a new instance of a Filter.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
apply(java.lang.Object value,
java.lang.Object... params)
Deprecated.
|
java.lang.Object |
apply(java.lang.Object value,
TemplateContext context,
java.lang.Object... params)
Applies the filter on the 'value', with the given 'context'.
|
protected java.lang.Object |
get(int index,
java.lang.Object... params)
Returns a value at a specific index from an array of parameters.
|
static Filter |
getFilter(java.lang.String name)
Retrieves a filter with a specific name.
|
static java.util.Map<java.lang.String,Filter> |
getFilters()
Returns all default filters.
|
static java.util.Map<java.lang.String,Filter> |
getFilters(Flavor flavor) |
static void |
registerFilter(Filter filter)
Registers a new filter.
|
areEqual, asArray, asBoolean, asFormattedNumber, asMap, asNumber, asString, asTemporal, canBeDouble, canBeInteger, isArray, isFalsy, isInteger, isMap, isNumber, isString, isTemporal, isTruthy, mapAsArray, temporalAsArrayprotected Filter()
public Filter(java.lang.String name)
name - the name of the filter.@Deprecated
public java.lang.Object apply(java.lang.Object value,
java.lang.Object... params)
apply(Object, TemplateContext, Object...)value - the string value `AAA` in: `{{ 'AAA' | f:1,2,3 }}`params - the values [1, 2, 3] in: `{{ 'AAA' | f:1,2,3 }}`public java.lang.Object apply(java.lang.Object value,
TemplateContext context,
java.lang.Object... params)
value - the string value `AAA` in: `{{ 'AAA' | f:1,2,3 }}`context - the template context.params - the values [1, 2, 3] in: `{{ 'AAA' | f:1,2,3 }}`protected java.lang.Object get(int index,
java.lang.Object... params)
index - the index of the value to be retrieved.params - the values.public static Filter getFilter(java.lang.String name)
name - the name of the filter to retrieve.public static java.util.Map<java.lang.String,Filter> getFilters()
public static void registerFilter(Filter filter)
filter - the filter to be registered.Copyright © 2012–2021. All rights reserved.