Class JSONOutputFormat
- Since:
- 2.3.24
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic JSONOutputFormatThe only instance (singleton) of thisOutputFormat. -
Method Summary
Modifier and TypeMethodDescriptionReturns the MIME type of the output format.getName()The short name used to refer to this format (like in the#ftlheader).booleanTells if this output format allows insertingTemplateMarkupOutputModel-s of another output formats into it.Methods inherited from class freemarker.core.OutputFormat
toString, toStringExtraProperties
-
Field Details
-
INSTANCE
The only instance (singleton) of thisOutputFormat.
-
-
Method Details
-
getName
Description copied from class:OutputFormatThe short name used to refer to this format (like in the#ftlheader).- Specified by:
getNamein classOutputFormat
-
getMimeType
Description copied from class:OutputFormatReturns the MIME type of the output format. This might comes handy when generating a HTTP response.nullnullif this output format doesn't clearly corresponds to a specific MIME type.- Specified by:
getMimeTypein classOutputFormat
-
isOutputFormatMixingAllowed
public boolean isOutputFormatMixingAllowed()Description copied from class:OutputFormatTells if this output format allows insertingTemplateMarkupOutputModel-s of another output formats into it.If
true, the foreignTemplateMarkupOutputModelwill be inserted into the output. If the current output format is aMarkupOutputFormatthis is done using theMarkupOutputFormat.outputForeign(TemplateMarkupOutputModel, Writer)method, which can implement smart conversions. The default behavior (and the only behavior for non-markup outputs) is to behave as 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.)truevalue is used byUndefinedOutputFormat.- Specified by:
isOutputFormatMixingAllowedin classOutputFormat
-