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 void
decompile
(Mustache.Delims delims, StringBuilder into) (package private) abstract void
execute
(Template tmpl, Template.Context ctx, Writer out) (package private) abstract Template.Segment
Recursively indent by the parameter indent.(package private) abstract boolean
Whether or not the segment is standalone.(package private) abstract void
visit
(Mustache.Visitor visitor) protected static void
write
(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\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.
-
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. Oncetrim
is called, standalone tags are determined so that proper (re)indentation will work without reparsing the template.- Returns:
- true if the tag is standalone.
-
write
-