Class Mustache.StringSegment
java.lang.Object
com.samskivert.mustache.Template.Segment
com.samskivert.mustache.Mustache.StringSegment
- Enclosing class:
Mustache
A simple segment that reproduces a string.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final intprotected final Stringprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionStringSegment(String text, boolean first) StringSegment(String text, int leadBlank, int trailBlank, boolean first) -
Method Summary
Modifier and TypeMethodDescriptionprivate static intvoiddecompile(Mustache.Delims delims, StringBuilder into) voidexecute(Template tmpl, Template.Context ctx, Writer out) (package private) Stringindent()Calculate indent for partial idententation(package private) Mustache.StringSegmentRecursively indent by the parameter indent.(package private) booleanWhether or not the segment is standalone.booleanprivate static StringtoString()booleanvoidvisit(Mustache.Visitor visitor) Methods inherited from class Template.Segment
write
-
Field Details
-
_text
-
_leadBlank
protected final int _leadBlank -
_trailBlank
protected final int _trailBlank -
_first
protected final boolean _first
-
-
Constructor Details
-
StringSegment
-
StringSegment
-
-
Method Details
-
leadsBlank
public boolean leadsBlank() -
trailsBlank
public boolean trailsBlank() -
trimLeadBlank
-
trimTrailBlank
-
indent
-
indent
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
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.
-
execute
- Specified by:
executein classTemplate.Segment
-
decompile
- Specified by:
decompilein classTemplate.Segment
-
visit
- Specified by:
visitin classTemplate.Segment
-
toString
-
reindent
-
blankPos
-