Package com.github.mustachejava
Interface Mustache
- All Superinterfaces:
Code
- All Known Implementing Classes:
DefaultMustache
The interface to Mustache objects
-
Method Summary
Modifier and TypeMethodDescriptionvoidAppend text to the mustache output.clone()Deep clone of the mustache object.default WriterExecute the mustache object with a given writer and a single scope context.default WriterExecute the mustache with a given writer and an array of scope objects.Code[]getCodes()Get the underlying code objects.voidExecute the mustache to output itself.voidinit()Initialize the mustache before executing.Invert this mustache given output text.Only executes the codes.voidChange the underlying codes of the mustache implementation.
-
Method Details
-
append
Append text to the mustache output. -
clone
Object clone()Deep clone of the mustache object. -
execute
Execute the mustache object with a given writer and a single scope context.- Parameters:
writer- write the output of the executed template herescope- the root object to use- Returns:
- the new writer
-
execute
-
execute
Execute the mustache with a given writer and an array of scope objects. The scopes are searched right-to-left for references. -
getCodes
Code[] getCodes()Get the underlying code objects. -
identity
Execute the mustache to output itself. -
init
void init()Initialize the mustache before executing. This is must be called at least once and is normally called already by the time you have a mustache instance. -
setCodes
Change the underlying codes of the mustache implementation. -
run
Only executes the codes. Does not append the text.- Parameters:
writer- write the output of the executed template herescopes- the array of scopes to execute- Returns:
- the replacement writer
-
invert
Invert this mustache given output text.- Parameters:
text- the text to parse- Returns:
- a tree of nodes representing the variables that when passed as a scope would reproduce the text
-