public class NumericExpressionHelper extends BasicHelper
BigDecimals.
{{numExpr val op="neg" out='It is a negative number!'}}
{{#numExpr val "90" op="gt"}}
val > 90
{{/numExpr}}
{{#numExpr val 10 op="eq"}}
val == 10
{{/numExpr}}
{{#numExpr val1 val2 op="le"}}
val1 <= val2
{{/numExpr}}
{{#numExpr val "1" 2 '3' op="in"}}
val = 1 or val = 2 or val = 3
{{/numExpr}}
HELPER_TAG_TYPES, NO_SUPPORTED_HASH_KEYSconfiguration| Constructor and Description |
|---|
NumericExpressionHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Options options)
Execute the helper.
|
void |
validate(HelperDefinition definition)
Helper should validate the tag definition (e.g. number of parameters)
during compilation and fail fast if necessary.
|
allowedTagTypes, getSupportedHashKeys, numberOfRequiredHashEntries, numberOfRequiredParametersappend, getHashValue, init, isSection, isUnescapeVariable, isVariablegetConfigurationKeys, checkNotInitialized, initclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfigurationKeys, initpublic void execute(Options options)
Helperpublic void validate(HelperDefinition definition)
HelperMustacheException with code
MustacheProblem.COMPILE_HELPER_VALIDATION_FAILURE should be
thrown in case of validation failure occurs.validate in interface Helpervalidate in class BasicHelperCopyright © 2015. All rights reserved.