public final class HelpersBuilder extends Object
HelpersBuilder.empty().addSet().addIsEven().add("myHelperName", new MyHelper()) .build();
MustacheEngineBuilder.registerHelpers(Map)
,
MustacheEngineBuilder.registerHelpers(Map, boolean)
Modifier and Type | Field and Description |
---|---|
static String |
ALT |
static String |
ASYNC |
static String |
CACHE |
static String |
CASE |
static String |
DEFAULT |
static String |
EACH |
static String |
EMBED |
static String |
EVAL |
static String |
FMT |
static String |
CHOOSE |
static String |
IF |
static String |
INCLUDE |
static String |
INVOKE |
static String |
IS |
static String |
IS_EQUAL |
static String |
IS_EVEN |
static String |
IS_NOT_EQUAL |
static String |
IS_NOT_NULL |
static String |
IS_NULL |
static String |
IS_ODD |
static String |
JOIN |
static String |
MAX |
static String |
MIN |
static String |
NUMERIC_EXPRESSION |
static String |
OTHERWISE |
static String |
REPEAT |
static String |
SET |
static String |
SWITCH |
static String |
TAG |
static String |
UNLESS |
static String |
WHEN |
static String |
WITH |
public static final String EACH
public static final String IF
public static final String UNLESS
public static final String WITH
public static final String IS
public static final String IS_EVEN
public static final String IS_ODD
public static final String SET
public static final String INCLUDE
public static final String EMBED
public static final String IS_EQUAL
public static final String IS_NOT_EQUAL
public static final String IS_NULL
public static final String IS_NOT_NULL
public static final String CHOOSE
public static final String WHEN
public static final String OTHERWISE
public static final String SWITCH
public static final String CASE
public static final String DEFAULT
public static final String JOIN
public static final String EVAL
public static final String NUMERIC_EXPRESSION
public static final String ASYNC
public static final String INVOKE
public static final String ALT
public static final String MIN
public static final String MAX
public static final String CACHE
public static final String REPEAT
public static final String FMT
public static final String TAG
public HelpersBuilder add(String name, Helper helper)
name
- helper
- public HelpersBuilder addEach()
EachHelper
with the "each" name.public HelpersBuilder addIf()
public HelpersBuilder addIf(String elseStartDelimiter, String elseEndDelimiter)
public HelpersBuilder addUnless()
UnlessHelper
with the "unless" name.public HelpersBuilder addWith()
WithHelper
with the "with" name.public HelpersBuilder addIs()
public HelpersBuilder addIsEven()
NumberIsEvenHelper
with the "isEven"
name.public HelpersBuilder addIsOdd()
NumberIsOddHelper
with the "isOdd"
name.public HelpersBuilder addSet()
public HelpersBuilder addInclude()
IncludeHelper
with the "include" name.public HelpersBuilder addEmbed()
EmbedHelper
with the "embed" name.public HelpersBuilder addEmbed(EmbedHelper.SourceProcessor processor)
EmbedHelper
with the "embed" name and the source processor.processor
- public HelpersBuilder addIsEqual()
EqualsHelper
with the "isEq" name.public HelpersBuilder addIsNotEqual()
EqualsHelper
which tests inequality with the
"isNotEq" name.public HelpersBuilder addIsNull()
NullCheckHelper
with the "isNull"
name.public HelpersBuilder addIsNotNull()
NullCheckHelper
which tests "not null" with
the "isNotNull" name.public HelpersBuilder addChoose()
ChooseHelper
with the "choose" name.
Also adds the dependent helpers.public HelpersBuilder addSwitch()
SwitchHelper
with the "switch" name.
Also adds the dependent helpers.public HelpersBuilder addSwitch(boolean caseDefaultIsBreak)
SwitchHelper
with the "switch" name.
Also adds the dependent helpers.caseDefaultIsBreak
- If true
the matching case helper terminates the flow by
default.public HelpersBuilder addJoin()
JoinHelper
.public HelpersBuilder addEval()
EvalHelper
.public HelpersBuilder addEval(EvalHelper.Notation notation)
EvalHelper
.notation
- public HelpersBuilder addNumExpr()
NumericExpressionHelper
.public HelpersBuilder addNumExpr(NumericExpressionHelper.Operator defaultOperator)
NumericExpressionHelper
.defaultOperator
- public HelpersBuilder addAsync()
AsyncHelper
.public HelpersBuilder addInvoke()
InvokeHelper
.public HelpersBuilder addAlt()
AlternativesHelper
.public HelpersBuilder addAlt(AlternativesHelper.Selector selector)
AlternativesHelper
.selector
- public HelpersBuilder addMin()
AlternativesHelper
.AlternativesHelper.MinSelector
public HelpersBuilder addMax()
AlternativesHelper
.AlternativesHelper.MaxSelector
public HelpersBuilder addCache()
CacheHelper
.AlternativesHelper.MaxSelector
public HelpersBuilder addRepeat()
RepeatHelper
.public HelpersBuilder addFmt()
public HelpersBuilder addTag()
public HelpersBuilder addBuiltin()
public HelpersBuilder addExtra()
public static HelpersBuilder empty()
public static HelpersBuilder builtin()
EngineConfigurationKey.HANDLEBARS_SUPPORT_ENABLED
set to
true
.addBuiltin()
public static HelpersBuilder extra()
addExtra()
public static HelpersBuilder all()
Copyright © 2017. All rights reserved.