- 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)
protected
SectionSegment(Mustache.SectionSegment original, Template.Segment[] segs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decompile(Mustache.Delims delims, java.lang.StringBuilder into)
void
execute(Template tmpl, Template.Context ctx, java.io.Writer out)
protected Mustache.SectionSegment
indent(java.lang.String indent, boolean first, boolean last)
Recursively indent by the parameter indent.Mustache.SectionSegment
replaceBlocks(java.util.Map<java.lang.String,Mustache.BlockSegment> blocks)
java.lang.String
toString()
void
visit(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:
execute
in classTemplate.Segment
-
decompile
public void decompile(Mustache.Delims delims, java.lang.StringBuilder into)
- Specified by:
decompile
in classTemplate.Segment
-
visit
public void visit(Mustache.Visitor visitor)
- Specified by:
visit
in classTemplate.Segment
-
indent
protected Mustache.SectionSegment indent(java.lang.String indent, boolean first, boolean last)
Description copied from class:Template.Segment
Recursively indent by the parameter indent.- Specified by:
indent
in classMustache.AbstractSectionSegment
- Parameters:
indent
- should be space characters that are not\n
.first
- append indent to the first line (regardless if it has a\n
or not).last
- append indent on the last\n
that 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:
toString
in classjava.lang.Object
-
-