public final class CombinedMarkupOutputFormat extends CommonMarkupOutputFormat<TemplateCombinedMarkupOutputModel>
Constructor and Description |
---|
CombinedMarkupOutputFormat(MarkupOutputFormat outer,
MarkupOutputFormat inner)
Same as
CombinedMarkupOutputFormat(String, MarkupOutputFormat, MarkupOutputFormat) with null as
the name parameter. |
CombinedMarkupOutputFormat(java.lang.String name,
MarkupOutputFormat outer,
MarkupOutputFormat inner) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
escapePlainText(java.lang.String plainTextContent)
Should give the same result as
MarkupOutputFormat.fromPlainTextByEscaping(String) and then
MarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel) , but the implementation may uses a more efficient solution. |
MarkupOutputFormat |
getInnerOutputFormat() |
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). |
MarkupOutputFormat |
getOuterOutputFormat() |
boolean |
isAutoEscapedByDefault()
Tells if by default auto-escaping should be on for this format.
|
boolean |
isLegacyBuiltInBypassed(java.lang.String builtInName)
Tells if a string built-in that can't handle a
TemplateMarkupOutputModel left hand operand can bypass
this object as is. |
boolean |
isOutputFormatMixingAllowed()
Tells if this output format allows inserting
TemplateMarkupOutputModel -s of another output formats into
it. |
protected TemplateCombinedMarkupOutputModel |
newTemplateMarkupOutputModel(java.lang.String plainTextContent,
java.lang.String markupContent)
Creates a new
CommonTemplateMarkupOutputModel that's bound to this OutputFormat instance. |
void |
output(java.lang.String textToEsc,
java.io.Writer out)
Equivalent to calling
MarkupOutputFormat.fromPlainTextByEscaping(String) and then
MarkupOutputFormat.output(TemplateMarkupOutputModel, Writer) , but the implementation may uses a more efficient solution. |
concat, fromMarkup, fromPlainTextByEscaping, getMarkupString, getSourcePlainText, isEmpty, output
toString, toStringExtraProperties
public CombinedMarkupOutputFormat(MarkupOutputFormat outer, MarkupOutputFormat inner)
CombinedMarkupOutputFormat(String, MarkupOutputFormat, MarkupOutputFormat)
with null
as
the name
parameter.public CombinedMarkupOutputFormat(java.lang.String name, MarkupOutputFormat outer, MarkupOutputFormat inner)
name
- Maybe null
, in which case it defaults to
outer.getName() + "{" + inner.getName() + "}"
.public java.lang.String getName()
OutputFormat
#ftl
header).getName
in class OutputFormat
public java.lang.String getMimeType()
OutputFormat
null
null
if this output format doesn't clearly corresponds to a specific MIME type.getMimeType
in class OutputFormat
public void output(java.lang.String textToEsc, java.io.Writer out) throws java.io.IOException, TemplateModelException
MarkupOutputFormat
MarkupOutputFormat.fromPlainTextByEscaping(String)
and then
MarkupOutputFormat.output(TemplateMarkupOutputModel, Writer)
, but the implementation may uses a more efficient solution.output
in class CommonMarkupOutputFormat<TemplateCombinedMarkupOutputModel>
java.io.IOException
TemplateModelException
public java.lang.String escapePlainText(java.lang.String plainTextContent) throws TemplateModelException
MarkupOutputFormat
MarkupOutputFormat.fromPlainTextByEscaping(String)
and then
MarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel)
, but the implementation may uses a more efficient solution.escapePlainText
in class MarkupOutputFormat<TemplateCombinedMarkupOutputModel>
TemplateModelException
public boolean isLegacyBuiltInBypassed(java.lang.String builtInName) throws TemplateModelException
MarkupOutputFormat
TemplateMarkupOutputModel
left hand operand can bypass
this object as is. A typical such case would be when a TemplateHTMLOutputModel
of "HTML" format bypasses
?html
.isLegacyBuiltInBypassed
in class MarkupOutputFormat<TemplateCombinedMarkupOutputModel>
TemplateModelException
public boolean isAutoEscapedByDefault()
MarkupOutputFormat
true
if you need to escape
on most of the places where you insert values.isAutoEscapedByDefault
in class CommonMarkupOutputFormat<TemplateCombinedMarkupOutputModel>
Configuration.setAutoEscapingPolicy(int)
public boolean isOutputFormatMixingAllowed()
OutputFormat
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 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 CommonMarkupOutputFormat<TemplateCombinedMarkupOutputModel>
public MarkupOutputFormat getOuterOutputFormat()
public MarkupOutputFormat getInnerOutputFormat()
protected TemplateCombinedMarkupOutputModel newTemplateMarkupOutputModel(java.lang.String plainTextContent, java.lang.String markupContent)
CommonMarkupOutputFormat
CommonTemplateMarkupOutputModel
that's bound to this OutputFormat
instance.newTemplateMarkupOutputModel
in class CommonMarkupOutputFormat<TemplateCombinedMarkupOutputModel>