Package com.github.mustachejava.codes
Class DefaultMustache
- java.lang.Object
-
- com.github.mustachejava.codes.DefaultCode
-
- com.github.mustachejava.codes.DefaultMustache
-
public class DefaultMustache extends DefaultCode implements Mustache
Default Mustache
-
-
Field Summary
Fields Modifier and Type Field Description private Code[]codesprivate booleaninitedprivate booleanisRecursive-
Fields inherited from class com.github.mustachejava.codes.DefaultCode
appended, binding, df, mustache, name, oh, returnThis, tc, type
-
-
Constructor Summary
Constructors Constructor Description DefaultMustache(TemplateContext tc, DefaultMustacheFactory df, Code[] codes, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Writerexecute(java.io.Writer writer, java.util.List<java.lang.Object> scopes)The default behavior is to run the codes and append the captured text.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.booleanisRecursive()java.io.Writerrun(java.io.Writer writer, java.util.List<java.lang.Object> scopes)Only executes the codes.voidsetCodes(Code[] newcodes)Change the underlying codes of the mustache implementation.voidsetRecursive()-
Methods inherited from class com.github.mustachejava.codes.DefaultCode
addScope, append, appendText, clone, clone, filterText, get, getName, invert, matchAppended, runIdentity, tag
-
-
-
-
Field Detail
-
codes
private Code[] codes
-
inited
private boolean inited
-
isRecursive
private boolean isRecursive
-
-
Constructor Detail
-
DefaultMustache
public DefaultMustache(TemplateContext tc, DefaultMustacheFactory df, Code[] codes, java.lang.String name)
-
-
Method Detail
-
getCodes
public Code[] getCodes()
Description copied from interface:MustacheGet the underlying code objects.
-
run
public java.io.Writer run(java.io.Writer writer, java.util.List<java.lang.Object> scopes)Description copied from interface:MustacheOnly executes the codes. Does not append the text.- Specified by:
runin interfaceMustache- Overrides:
runin classDefaultCode- Parameters:
writer- write the output of the executed template herescopes- the array of scopes to execute- Returns:
- the replacement writer
-
invert
public Node invert(java.lang.String text)
Description copied from interface:MustacheInvert this mustache given output text.
-
setCodes
public void setCodes(Code[] newcodes)
Description copied from interface:MustacheChange the underlying codes of the mustache implementation.
-
execute
public java.io.Writer execute(java.io.Writer writer, java.util.List<java.lang.Object> scopes)Description copied from class:DefaultCodeThe default behavior is to run the codes and append the captured text.
-
identity
public void identity(java.io.Writer writer)
Description copied from interface:MustacheExecute the mustache to output itself.
-
init
public void init()
Description copied from interface:MustacheInitialize 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.
-
isRecursive
public boolean isRecursive()
-
setRecursive
public void setRecursive()
-
-