Class Mustache.AbstractSectionSegment
java.lang.Object
com.samskivert.mustache.Template.Segment
com.samskivert.mustache.Mustache.NamedSegment
com.samskivert.mustache.Mustache.AbstractSectionSegment
- All Implemented Interfaces:
Mustache.BlockReplaceable, Mustache.StandaloneSection
- Direct Known Subclasses:
Mustache.BlockSegment, Mustache.InvertedSegment, Mustache.SectionSegment
- Enclosing class:
Mustache
protected abstract static class Mustache.AbstractSectionSegment
extends Mustache.NamedSegment
implements Mustache.StandaloneSection
A helper class for section-like segments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Mustache.Compilerprotected final Template.Segment[]protected booleanprotected booleanFields inherited from class Mustache.NamedSegment
_line, _name -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSectionSegment(Mustache.AbstractSectionSegment original, Template.Segment[] segs) protectedAbstractSectionSegment(Mustache.Compiler compiler, String name, Template.Segment[] segs, int line) -
Method Summary
Modifier and TypeMethodDescription_segs()protected voidexecuteSegs(Template tmpl, Template.Context ctx, Writer out) protected abstract Mustache.AbstractSectionSegmentRecursively indent by the parameter indent.booleanWhether or not the segment is standalone.booleanbooleanvoidstandaloneEnd(boolean standaloneEnd) voidstandaloneStart(boolean standaloneStart) Methods inherited from class Template.Segment
decompile, execute, visit, writeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Mustache.BlockReplaceable
replaceBlocksMethods inherited from interface Mustache.StandaloneSection
firstLeadsBlank, lastTrailsBlank, trimFirstBlank, trimLastBlank
-
Field Details
-
_comp
-
_segs
-
_standaloneStart
protected boolean _standaloneStart -
_standaloneEnd
protected boolean _standaloneEnd
-
-
Constructor Details
-
AbstractSectionSegment
protected AbstractSectionSegment(Mustache.Compiler compiler, String name, Template.Segment[] segs, int line) -
AbstractSectionSegment
-
-
Method Details
-
executeSegs
-
indent
protected abstract Mustache.AbstractSectionSegment indent(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.
-
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 classTemplate.Segment- Returns:
- true if the tag is standalone.
-
isStandaloneStart
public boolean isStandaloneStart()- Specified by:
isStandaloneStartin interfaceMustache.StandaloneSection
-
isStandaloneEnd
public boolean isStandaloneEnd()- Specified by:
isStandaloneEndin interfaceMustache.StandaloneSection
-
standaloneStart
public void standaloneStart(boolean standaloneStart) - Specified by:
standaloneStartin interfaceMustache.StandaloneSection
-
standaloneEnd
public void standaloneEnd(boolean standaloneEnd) - Specified by:
standaloneEndin interfaceMustache.StandaloneSection
-
_segs
- Specified by:
_segsin interfaceMustache.StandaloneSection
-