- java.lang.Object
-
- com.samskivert.mustache.Template.Segment
-
- com.samskivert.mustache.Mustache.NamedSegment
-
- com.samskivert.mustache.Mustache.AbstractSectionSegment
-
- com.samskivert.mustache.Mustache.SectionSegment
-
- All Implemented Interfaces:
Mustache.BlockReplaceable,Mustache.StandaloneSection
- Enclosing class:
- Mustache
protected static class Mustache.SectionSegment extends Mustache.AbstractSectionSegment
A segment that represents a section.
-
-
Field Summary
-
Fields inherited from class com.samskivert.mustache.Mustache.AbstractSectionSegment
_comp, _segs, _standaloneEnd, _standaloneStart
-
Fields inherited from class com.samskivert.mustache.Mustache.NamedSegment
_line, _name
-
-
Constructor Summary
Constructors Modifier Constructor Description SectionSegment(Mustache.Compiler compiler, java.lang.String name, Template.Segment[] segs, int line)protectedSectionSegment(Mustache.SectionSegment original, Template.Segment[] segs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecompile(Mustache.Delims delims, java.lang.StringBuilder into)voidexecute(Template tmpl, Template.Context ctx, java.io.Writer out)protected Mustache.SectionSegmentindent(java.lang.String indent, boolean first, boolean last)Recursively indent by the parameter indent.Mustache.SectionSegmentreplaceBlocks(java.util.Map<java.lang.String,Mustache.BlockSegment> blocks)java.lang.StringtoString()voidvisit(Mustache.Visitor visitor)-
Methods inherited from class com.samskivert.mustache.Mustache.AbstractSectionSegment
_segs, executeSegs, isStandalone, isStandaloneEnd, isStandaloneStart, standaloneEnd, standaloneStart
-
Methods inherited from class com.samskivert.mustache.Template.Segment
write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.samskivert.mustache.Mustache.StandaloneSection
firstLeadsBlank, lastTrailsBlank, trimFirstBlank, trimLastBlank
-
-
-
-
Constructor Detail
-
SectionSegment
public SectionSegment(Mustache.Compiler compiler, java.lang.String name, Template.Segment[] segs, int line)
-
SectionSegment
protected SectionSegment(Mustache.SectionSegment original, Template.Segment[] segs)
-
-
Method Detail
-
execute
public void execute(Template tmpl, Template.Context ctx, java.io.Writer out)
- Specified by:
executein classTemplate.Segment
-
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.SectionSegment indent(java.lang.String indent, boolean first, boolean last)
Description copied from class:Template.SegmentRecursively indent by the parameter indent.- Specified by:
indentin classMustache.AbstractSectionSegment- 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.
-
replaceBlocks
public Mustache.SectionSegment replaceBlocks(java.util.Map<java.lang.String,Mustache.BlockSegment> blocks)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-