public class HTMLOutputFormat extends CommonMarkupOutputFormat<TemplateHTMLOutputModel>
StringUtil.XHTMLEnc(String)). The ?html, ?xhtml and ?xml built-ins silently bypass
template output values of the type produced by this output format (TemplateHTMLOutputModel).
This class was final before 2.3.29.
| Modifier and Type | Field and Description |
|---|---|
static HTMLOutputFormat |
INSTANCE
The only instance (singleton) of this
OutputFormat. |
| Modifier | Constructor and Description |
|---|---|
protected |
HTMLOutputFormat() |
| 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 use a more efficient solution. |
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 |
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. |
protected TemplateHTMLOutputModel |
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 use a more efficient solution. |
concat, fromMarkup, fromPlainTextByEscaping, getMarkupString, getSourcePlainText, isAutoEscapedByDefault, isEmpty, isOutputFormatMixingAllowed, outputoutputForeigntoString, toStringExtraPropertiespublic static final HTMLOutputFormat INSTANCE
OutputFormat.public 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 OutputFormatpublic void output(java.lang.String textToEsc,
java.io.Writer out)
throws java.io.IOException,
TemplateModelException
MarkupOutputFormatMarkupOutputFormat.fromPlainTextByEscaping(String) and then
MarkupOutputFormat.output(TemplateMarkupOutputModel, Writer), but the implementation may use a more efficient solution.output in class CommonMarkupOutputFormat<TemplateHTMLOutputModel>java.io.IOExceptionTemplateModelExceptionpublic java.lang.String escapePlainText(java.lang.String plainTextContent)
MarkupOutputFormatMarkupOutputFormat.fromPlainTextByEscaping(String) and then
MarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel), but the implementation may use a more efficient solution.escapePlainText in class MarkupOutputFormat<TemplateHTMLOutputModel>public boolean isLegacyBuiltInBypassed(java.lang.String builtInName)
MarkupOutputFormatTemplateMarkupOutputModel 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<TemplateHTMLOutputModel>protected TemplateHTMLOutputModel newTemplateMarkupOutputModel(java.lang.String plainTextContent, java.lang.String markupContent)
CommonMarkupOutputFormatCommonTemplateMarkupOutputModel that's bound to this OutputFormat instance.
When this is called from CommonMarkupOutputFormat, exactly one of the parameters will be
non-null.newTemplateMarkupOutputModel in class CommonMarkupOutputFormat<TemplateHTMLOutputModel>plainTextContent - null if the content is markup that possibly can be described as plain text without loss.markupContent - Typically will be null if plainTextContent is not null. While the plain text always
can be converted to markup via MarkupOutputFormat.escapePlainText(String), it's up to the implementation if it wants
to do that now and store the markup, or later on demand (like each time when
CommonMarkupOutputFormat.getMarkupString(CommonTemplateMarkupOutputModel) is called).