Package freemarker.core
Class JavaScriptOutputFormat
- java.lang.Object
-
- freemarker.core.OutputFormat
-
- freemarker.core.JavaScriptOutputFormat
-
public class JavaScriptOutputFormat extends OutputFormat
Represents the JavaScript output format (MIME type "application/javascript", name "JavaScript"). This format doesn't support escaping.- Since:
- 2.3.24
-
-
Field Summary
Fields Modifier and Type Field Description static JavaScriptOutputFormat
INSTANCE
The only instance (singleton) of thisOutputFormat
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 insertingTemplateMarkupOutputModel
-s of another output formats into it.-
Methods inherited from class freemarker.core.OutputFormat
toString, toStringExtraProperties
-
-
-
-
Field Detail
-
INSTANCE
public static final JavaScriptOutputFormat INSTANCE
The only instance (singleton) of thisOutputFormat
.
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:OutputFormat
The short name used to refer to this format (like in the#ftl
header).- Specified by:
getName
in classOutputFormat
-
getMimeType
public java.lang.String getMimeType()
Description copied from class:OutputFormat
Returns the MIME type of the output format. This might comes handy when generating a HTTP response.null
null
if this output format doesn't clearly corresponds to a specific MIME type.- Specified by:
getMimeType
in classOutputFormat
-
isOutputFormatMixingAllowed
public boolean isOutputFormatMixingAllowed()
Description copied from class:OutputFormat
Tells if this output format allows insertingTemplateMarkupOutputModel
-s of another output formats into it. Iftrue
, the foreignTemplateMarkupOutputModel
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 returnsfalse
(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 byUndefinedOutputFormat
.- Specified by:
isOutputFormatMixingAllowed
in classOutputFormat
-
-