Package com.github.mustachejava.codes
Class PartialCode
- java.lang.Object
-
- com.github.mustachejava.codes.DefaultCode
-
- com.github.mustachejava.codes.PartialCode
-
- All Implemented Interfaces:
Code,java.lang.Cloneable
- Direct Known Subclasses:
ExtendCode,SpecMustacheVisitor.SpecPartialCode
public class PartialCode extends DefaultCode
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringdirprotected java.lang.Stringextensionprotected booleanisRecursiveprotected Mustachepartialprotected intrecrusionLimit-
Fields inherited from class com.github.mustachejava.codes.DefaultCode
appended, binding, df, mustache, name, oh, returnThis, tc, type
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPartialCode(TemplateContext tc, DefaultMustacheFactory df, Mustache mustache, java.lang.String type, java.lang.String variable)PartialCode(TemplateContext tc, DefaultMustacheFactory cf, java.lang.String variable)
-
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.protected java.io.WriterexecutePartial(java.io.Writer writer, java.util.List<java.lang.Object> scopes)Code[]getCodes()voididentity(java.io.Writer writer)voidinit()protected java.lang.StringpartialName()Builds the file name to be included by this partial tag.voidsetCodes(Code[] newcodes)-
Methods inherited from class com.github.mustachejava.codes.DefaultCode
addScope, append, appendText, clone, clone, filterText, get, getName, invert, matchAppended, run, runIdentity, tag
-
-
-
-
Field Detail
-
extension
protected final java.lang.String extension
-
dir
protected final java.lang.String dir
-
partial
protected Mustache partial
-
recrusionLimit
protected int recrusionLimit
-
isRecursive
protected boolean isRecursive
-
-
Constructor Detail
-
PartialCode
protected PartialCode(TemplateContext tc, DefaultMustacheFactory df, Mustache mustache, java.lang.String type, java.lang.String variable)
-
PartialCode
public PartialCode(TemplateContext tc, DefaultMustacheFactory cf, java.lang.String variable)
-
-
Method Detail
-
identity
public void identity(java.io.Writer writer)
- Specified by:
identityin interfaceCode- Overrides:
identityin classDefaultCode
-
getCodes
public Code[] getCodes()
- Specified by:
getCodesin interfaceCode- Overrides:
getCodesin classDefaultCode
-
setCodes
public void setCodes(Code[] newcodes)
- Specified by:
setCodesin interfaceCode- Overrides:
setCodesin classDefaultCode
-
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.- Specified by:
executein interfaceCode- Overrides:
executein classDefaultCode- Parameters:
writer- The writer to write the output toscopes- The scopes to evaluate the embedded names against.
-
executePartial
protected java.io.Writer executePartial(java.io.Writer writer, java.util.List<java.lang.Object> scopes)
-
init
public void init()
- Specified by:
initin interfaceCode- Overrides:
initin classDefaultCode
-
partialName
protected java.lang.String partialName()
Builds the file name to be included by this partial tag. Default implementation ppends the tag contents with the current file's extension.- Returns:
- The filename to be included by this partial tag
-
-