public class EvalHelper extends BasicHelper
First a key is built from the params, or rather their
Object.toString() representations, by default dot notation is used.
Then the helper attempts to find the value from the context. If the helper
represents a section and the value is not null the value is pushed on the
context stack and the section is rendered. If the helper represents a
variable and the value is null, the current MissingValueHandler is
used. If the helper represents a variable and the final value is not null the
the value's Object.toString() is rendered.
{{eval "foo" "bar"}}
is equivalent to:
{{foo.bar}}
On the other hand:
{{#eval "list" idx}}
Element name: {{name}}
{{/eval}}
is equivalent to (provided the idx evaluates to 1):
{{#with list.1}}
Element name: {{name}}
{{/with}}
EvalHelper.Notation,
KeySplitter| Modifier and Type | Class and Description |
|---|---|
static class |
EvalHelper.BracketDotNotation |
static class |
EvalHelper.DotNotation |
static interface |
EvalHelper.Notation |
HELPER_TAG_TYPESconfiguration| Constructor and Description |
|---|
EvalHelper() |
EvalHelper(EvalHelper.Notation notation) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Options options)
Execute the helper.
|
allowedTagTypes, getRequiredHashKeys, getSupportedHashKeys, numberOfRequiredHashEntries, numberOfRequiredParameters, validateappend, convertAndAppend, convertValue, init, isSection, isUnescapeVariable, isVariablecheckNotInitialized, initclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfigurationKeys, initpublic EvalHelper()
EvalHelper.DotNotationpublic EvalHelper(EvalHelper.Notation notation)
notation - The notation to be used when constructing keysCopyright © 2017. All rights reserved.