public final class PlainTextOutputFormat extends OutputFormat
The main difference from UndefinedOutputFormat is that this format doesn't allow inserting values of another
output format into itself (unless they can be converted to plain text), while UndefinedOutputFormat would
just insert the foreign "markup" as is. Also, this format has {"text/plain"} MIME type, while
UndefinedOutputFormat has null.
| Modifier and Type | Field and Description |
|---|---|
static PlainTextOutputFormat |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getMimeType()
Returns the MIME type of the output format.
|
java.lang.String |
getName()
The short name used to refer to this format (like in the
#ftl header). |
boolean |
isOutputFormatMixingAllowed()
Tells if this output format allows inserting
TemplateMarkupOutputModel-s of another output formats into
it. |
toString, toStringExtraPropertiespublic static final PlainTextOutputFormat INSTANCE
public boolean isOutputFormatMixingAllowed()
OutputFormatTemplateMarkupOutputModel-s of another output formats into
it. If true, the foreign TemplateMarkupOutputModel will be inserted into the output as is (like
if the surrounding output format was the same). This is usually a bad idea to allow, as such an event could
indicate application bugs. If this method returns false (recommended), then FreeMarker will try to
assimilate the inserted value by converting its format to this format, which will currently (2.3.24) cause
exception, unless the inserted value is made by escaping plain text and the target format is non-escaping, in
which case format conversion is trivially possible. (It's not impossible that conversions will be extended beyond
this, if there will be demand for that.)
true value is used by UndefinedOutputFormat.
isOutputFormatMixingAllowed in class OutputFormatpublic java.lang.String getName()
OutputFormat#ftl header).getName in class OutputFormatpublic java.lang.String getMimeType()
OutputFormatnull
null if this output format doesn't clearly corresponds to a specific MIME type.getMimeType in class OutputFormat