- java.lang.Object
-
- com.samskivert.mustache.Template.Segment
-
- com.samskivert.mustache.Mustache.NamedSegment
-
- com.samskivert.mustache.Mustache.AbstractSectionSegment
-
- com.samskivert.mustache.Mustache.InvertedSegment
-
- All Implemented Interfaces:
Mustache.BlockReplaceable
,Mustache.StandaloneSection
- Enclosing class:
- Mustache
protected static class Mustache.InvertedSegment extends Mustache.AbstractSectionSegment
A segment that represents an inverted section.
-
-
Field Summary
Fields Modifier and Type Field Description protected Mustache.Compiler
_comp
-
Fields inherited from class com.samskivert.mustache.Mustache.AbstractSectionSegment
_segs, _standaloneEnd, _standaloneStart
-
Fields inherited from class com.samskivert.mustache.Mustache.NamedSegment
_line, _name
-
-
Constructor Summary
Constructors Modifier Constructor Description InvertedSegment(Mustache.Compiler compiler, java.lang.String name, Template.Segment[] segs, int line)
protected
InvertedSegment(Mustache.InvertedSegment 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.InvertedSegment
indent(java.lang.String indent, boolean first, boolean last)
Recursively indent by the parameter indent.Mustache.InvertedSegment
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
-
-
-
-
Field Detail
-
_comp
protected final Mustache.Compiler _comp
-
-
Constructor Detail
-
InvertedSegment
public InvertedSegment(Mustache.Compiler compiler, java.lang.String name, Template.Segment[] segs, int line)
-
InvertedSegment
protected InvertedSegment(Mustache.InvertedSegment 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.InvertedSegment 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.InvertedSegment replaceBlocks(java.util.Map<java.lang.String,Mustache.BlockSegment> blocks)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-