public abstract class OutputFormat extends Object
Constructor and Description |
---|
OutputFormat() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getMimeType()
Returns the MIME type of the output format.
|
abstract String |
getName()
The short name used to refer to this format (like in the
#ftl header). |
abstract boolean |
isOutputFormatMixingAllowed()
Tells if this output format allows inserting
TemplateMarkupOutputModel -s of another output formats into
it. |
String |
toString()
Returns the short description of this format, to be used in error messages.
|
protected String |
toStringExtraProperties()
Should be like
"foo=\"something\", bar=123" ; this will be inserted inside the parentheses in
toString() . |
public abstract String getName()
#ftl
header).public abstract String getMimeType()
null
if this output format doesn't clearly corresponds to a specific MIME type.public abstract boolean isOutputFormatMixingAllowed()
TemplateMarkupOutputModel
-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 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
.
public final String toString()
toStringExtraProperties()
to customize this.protected String toStringExtraProperties()
"foo=\"something\", bar=123"
; this will be inserted inside the parentheses in
toString()
. Shouldn't return null
; should return ""
if there are no extra properties.