public class JoinHelper extends BasicValueHelper
Object.toString()
values together with the specified delimiter
(optional). Elements of Iterable
s 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_TYPES
HELPER_TAG_TYPES
configuration
Constructor and Description |
---|
JoinHelper() |
Modifier and Type | Method and Description |
---|---|
void |
execute(Options options)
Execute the helper.
|
protected Set<String> |
getSupportedHashKeys() |
allowedTagTypes
getRequiredHashKeys, numberOfRequiredHashEntries, numberOfRequiredParameters, validate
append, convertAndAppend, convertValue, init, isSection, isUnescapeVariable, isVariable
checkNotInitialized, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfigurationKeys, init
public void execute(Options options)
Helper
protected Set<String> getSupportedHashKeys()
getSupportedHashKeys
in class BasicHelper
*
to
allow any hash keysCopyright © 2017. All rights reserved.