Class Mustache.IncludedTemplateSegment
java.lang.Object
com.samskivert.mustache.Template.Segment
com.samskivert.mustache.Mustache.NamedSegment
com.samskivert.mustache.Mustache.AbstractPartialSegment
com.samskivert.mustache.Mustache.IncludedTemplateSegment
- Enclosing class:
Mustache
A segment that loads and executes a sub-template by spec called a partial.
-
Field Summary
FieldsFields inherited from class Mustache.AbstractPartialSegment
_comp, _indentFields inherited from class Mustache.NamedSegment
_line, _name -
Constructor Summary
ConstructorsModifierConstructorDescriptionIncludedTemplateSegment(Mustache.Compiler compiler, String name, int line) privateIncludedTemplateSegment(Mustache.Compiler compiler, String name, int line, String indent) -
Method Summary
Modifier and TypeMethodDescriptionvoiddecompile(Mustache.Delims delims, StringBuilder into) protected Mustache.IncludedTemplateSegmentRecursively indent by the parameter indent.booleanWhether or not the segment is standalone.toString()voidvisit(Mustache.Visitor visitor) Methods inherited from class Mustache.AbstractPartialSegment
_loadTemplate, execute, getTemplateMethods inherited from class Template.Segment
write
-
Field Details
-
_standalone
protected boolean _standalone
-
-
Constructor Details
-
IncludedTemplateSegment
-
IncludedTemplateSegment
-
-
Method Details
-
decompile
- Specified by:
decompilein classTemplate.Segment
-
visit
- Specified by:
visitin classTemplate.Segment
-
indent
Description copied from class:Template.SegmentRecursively indent by the parameter indent.- Specified by:
indentin classTemplate.Segment- Parameters:
indent- should be space characters that are not\n.first- append indent to the first line (regardless if it has a\nor not).last- append indent on the last\nthat has no text after it.- Returns:
- a newly created segment or the same segment if nothing changed.
-
toString
-
isStandalone
public boolean isStandalone()Description copied from class:Template.SegmentWhether or not the segment is standalone. The definition of standalone is defined by the mustache spec. String and variable tags are never standalone. For blocks this is based on the closing tag. Oncetrimis called, standalone tags are determined so that proper (re)indentation will work without reparsing the template.- Specified by:
isStandalonein classMustache.AbstractPartialSegment- Returns:
- true if the tag is standalone.
-