Class Template.Segment
java.lang.Object
com.samskivert.mustache.Template.Segment
- Direct Known Subclasses:
Mustache.FauxSegment, Mustache.NamedSegment, Mustache.StringSegment
- Enclosing class:
Template
A template is broken into segments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract voiddecompile(Mustache.Delims delims, StringBuilder into) (package private) abstract voidexecute(Template tmpl, Template.Context ctx, Writer out) (package private) abstract Template.SegmentRecursively indent by the parameter indent.(package private) abstract booleanWhether or not the segment is standalone.(package private) abstract voidvisit(Mustache.Visitor visitor) protected static voidwrite(Writer out, CharSequence data)
-
Constructor Details
-
Segment
protected Segment()
-
-
Method Details
-
execute
-
decompile
-
visit
-
indent
Recursively indent by the parameter indent.- 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
abstract boolean isStandalone()Whether 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.- Returns:
- true if the tag is standalone.
-
write
-