public class JoinHelper extends BasicValueHelper
Object.toString() values together with the specified delimiter
(optional). Elements of Iterables and arrays are treated as separate
objects.
The following template will render "Hello Martin, John!" for the list of strings "Martin" and "John":
Hello {{join listOfNames delimiter=", " }}!
Note that the output is escaped (if needed). It's possible to use unescape variable though, e.g.:
Hello {{&join "Martin" "John" delimiter=", " }}
An optional lambda may be applied to each value. Note that the
lambda is always processed as with Lambda.InputType.LITERAL and
Lambda.isReturnValueInterpolated() set to false.
Hello {{&join "Martin" "John" delimiter=" " lambda=makeItalic}}
VALUE_TAG_TYPESHELPER_TAG_TYPESconfiguration| Constructor and Description |
|---|
JoinHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Options options)
Execute the helper.
|
protected Set<String> |
getSupportedHashKeys() |
allowedTagTypesgetRequiredHashKeys, numberOfRequiredHashEntries, numberOfRequiredParameters, validateappend, convertAndAppend, convertValue, init, isSection, isUnescapeVariable, isVariablecheckNotInitialized, initclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfigurationKeys, initpublic void execute(Options options)
Helperprotected Set<String> getSupportedHashKeys()
getSupportedHashKeys in class BasicHelper* to
allow any hash keysCopyright © 2017. All rights reserved.