Package freemarker.core
Class HTMLOutputFormat
java.lang.Object
Represents the HTML output format (MIME type "text/html", name "HTML"). This format escapes by default (via
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.
- Since:
- 2.3.24
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HTMLOutputFormatThe only instance (singleton) of thisOutputFormat. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionescapePlainText(String plainTextContent) Should give the same result asMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel), but the implementation may uses a more efficient solution.Returns the MIME type of the output format.getName()The short name used to refer to this format (like in the#ftlheader).booleanisLegacyBuiltInBypassed(String builtInName) Tells if a string built-in that can't handle aTemplateMarkupOutputModelleft hand operand can bypass this object as is.protected TemplateHTMLOutputModelnewTemplateMarkupOutputModel(String plainTextContent, String markupContent) Creates a newCommonTemplateMarkupOutputModelthat's bound to thisOutputFormatinstance.voidEquivalent to callingMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.output(TemplateMarkupOutputModel, Writer), but the implementation may uses a more efficient solution.Methods inherited from class freemarker.core.CommonMarkupOutputFormat
concat, fromMarkup, fromPlainTextByEscaping, getMarkupString, getSourcePlainText, isAutoEscapedByDefault, isEmpty, isOutputFormatMixingAllowed, outputMethods inherited from class freemarker.core.OutputFormat
toString, toStringExtraProperties
-
Field Details
-
INSTANCE
The only instance (singleton) of thisOutputFormat.
-
-
Constructor Details
-
HTMLOutputFormat
protected HTMLOutputFormat()- Since:
- 2.3.29
-
-
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
-
output
Description copied from class:MarkupOutputFormatEquivalent to callingMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.output(TemplateMarkupOutputModel, Writer), but the implementation may uses a more efficient solution.- Specified by:
outputin classCommonMarkupOutputFormat<TemplateHTMLOutputModel>- Throws:
IOExceptionTemplateModelException
-
escapePlainText
Description copied from class:MarkupOutputFormatShould give the same result asMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel), but the implementation may uses a more efficient solution.- Specified by:
escapePlainTextin classMarkupOutputFormat<TemplateHTMLOutputModel>
-
isLegacyBuiltInBypassed
Description copied from class:MarkupOutputFormatTells if a string built-in that can't handle aTemplateMarkupOutputModelleft hand operand can bypass this object as is. A typical such case would be when aTemplateHTMLOutputModelof "HTML" format bypasses?html.- Specified by:
isLegacyBuiltInBypassedin classMarkupOutputFormat<TemplateHTMLOutputModel>
-
newTemplateMarkupOutputModel
protected TemplateHTMLOutputModel newTemplateMarkupOutputModel(String plainTextContent, String markupContent) Description copied from class:CommonMarkupOutputFormatCreates a newCommonTemplateMarkupOutputModelthat's bound to thisOutputFormatinstance.- Specified by:
newTemplateMarkupOutputModelin classCommonMarkupOutputFormat<TemplateHTMLOutputModel>
-