Package com.github.mustachejava
Interface Mustache
-
- All Superinterfaces:
Code
- All Known Implementing Classes:
DefaultMustache
public interface Mustache extends Code
The interface to Mustache objects
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidappend(java.lang.String text)Append text to the mustache output.java.lang.Objectclone()Deep clone of the mustache object.default java.io.Writerexecute(java.io.Writer writer, java.lang.Object scope)Execute the mustache object with a given writer and a single scope context.default java.io.Writerexecute(java.io.Writer writer, java.lang.Object[] scopes)java.io.Writerexecute(java.io.Writer writer, java.util.List<java.lang.Object> scopes)Execute the mustache with a given writer and an array of scope objects.Code[]getCodes()Get the underlying code objects.voididentity(java.io.Writer writer)Execute the mustache to output itself.voidinit()Initialize the mustache before executing.Nodeinvert(java.lang.String text)Invert this mustache given output text.java.io.Writerrun(java.io.Writer writer, java.util.List<java.lang.Object> scopes)Only executes the codes.voidsetCodes(Code[] codes)Change the underlying codes of the mustache implementation.
-
-
-
Method Detail
-
append
void append(java.lang.String text)
Append text to the mustache output.
-
clone
java.lang.Object clone()
Deep clone of the mustache object.
-
execute
default java.io.Writer execute(java.io.Writer writer, java.lang.Object scope)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
default java.io.Writer execute(java.io.Writer writer, java.lang.Object[] scopes)
-
execute
java.io.Writer execute(java.io.Writer writer, java.util.List<java.lang.Object> scopes)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
void identity(java.io.Writer writer)
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
void setCodes(Code[] codes)
Change the underlying codes of the mustache implementation.
-
run
java.io.Writer run(java.io.Writer writer, java.util.List<java.lang.Object> scopes)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
Node invert(java.lang.String text)
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
-
-