Module com.samskivert.jmustache
Package com.samskivert.mustache
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
protected static class Mustache.IncludedTemplateSegment extends Mustache.AbstractPartialSegment
A segment that loads and executes a sub-template by spec called a partial.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_standalone-
Fields inherited from class com.samskivert.mustache.Mustache.AbstractPartialSegment
_comp, _indent
-
Fields inherited from class com.samskivert.mustache.Mustache.NamedSegment
_line, _name
-
-
Constructor Summary
Constructors Modifier Constructor Description IncludedTemplateSegment(Mustache.Compiler compiler, java.lang.String name, int line)privateIncludedTemplateSegment(Mustache.Compiler compiler, java.lang.String name, int line, java.lang.String indent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecompile(Mustache.Delims delims, java.lang.StringBuilder into)protected Mustache.IncludedTemplateSegmentindent(java.lang.String indent, boolean first, boolean last)Recursively indent by the parameter indent.booleanisStandalone()Whether or not the segment is standalone.java.lang.StringtoString()voidvisit(Mustache.Visitor visitor)-
Methods inherited from class com.samskivert.mustache.Mustache.AbstractPartialSegment
_loadTemplate, execute, getTemplate
-
Methods inherited from class com.samskivert.mustache.Template.Segment
write
-
-
-
-
Constructor Detail
-
IncludedTemplateSegment
public IncludedTemplateSegment(Mustache.Compiler compiler, java.lang.String name, int line)
-
IncludedTemplateSegment
private IncludedTemplateSegment(Mustache.Compiler compiler, java.lang.String name, int line, java.lang.String indent)
-
-
Method Detail
-
decompile
public void decompile(Mustache.Delims delims, java.lang.StringBuilder into)
- Specified by:
decompilein classTemplate.Segment
-
visit
public void visit(Mustache.Visitor visitor)
- Specified by:
visitin classTemplate.Segment
-
indent
protected Mustache.IncludedTemplateSegment indent(java.lang.String indent, boolean first, boolean last)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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.
-
-