Package liqp.filters
Class Filter
java.lang.Object
liqp.LValue
liqp.filters.Filter
- Direct Known Subclasses:
Abs,Append,At_Least,At_Most,Capitalize,Ceil,Compact,Concat,Date,Default,Divided_By,Downcase,Escape,Escape_Once,First,Floor,H,Join,Json,Last,Lstrip,Map,Minus,Modulo,Newline_To_Br,Normalize_Whitespace,Plus,Pop,Prepend,Push,Relative_Url,Remove,Remove_First,Replace,Replace_First,Reverse,Round,Rstrip,Shift,Size,Slice,Sort,Sort_Natural,Split,Strip,Strip_HTML,Strip_Newlines,Times,Truncate,Truncatewords,Uniq,Unshift,Upcase,Url_Decode,Url_Encode,Where,Where_Exp
Output markup takes filters. Filters are simple methods. The first parameter is always the output of
the left side of the filter. The return value of the filter will be the new left value when the next
filter is run. When there are no more filters, the template will receive the resulting string.
-- https://github.com/Shopify/liquid/wiki/Liquid-for-Designers
-
Field Summary
FieldsFields inherited from class liqp.LValue
BREAK, CONTINUE, rubyDateTimeFormat -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class liqp.LValue
areEqual, asAppendableObject, asArray, asBoolean, asFormattedNumber, asList, asMap, asNumber, asRubyDate, asStrictNumber, asString, asTemporal, canBeDouble, canBeInteger, canBeNumber, isArray, isBlank, isFalsy, isInteger, isMap, isNumber, isString, isTemporal, isTruthy, mapAsArray, temporalAsArray
-
Field Details
-
name
The name of the filter.
-
-
Constructor Details
-
Filter
protected Filter()Used for all package protected filters in the liqp.filters-package whose name is their class name lower cased. -
Filter
Creates a new instance of a Filter.- Parameters:
name- the name of the filter.
-
-
Method Details
-
getName
Returns the name of the filter.- Returns:
- The name.
-
apply
Applies the filter on the 'value', with the given 'context'.- Parameters:
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 }}`- Returns:
- the result of the filter.
-
get
Returns a value at a specific index from an array of parameters. If no such index exists, a RuntimeException is thrown.- Parameters:
index- the index of the value to be retrieved.params- the values.- Returns:
- a value at a specific index from an array of parameters.
-