Package freemarker.core
Class XHTMLOutputFormat
java.lang.Object
freemarker.core.OutputFormat
freemarker.core.MarkupOutputFormat<MO>
freemarker.core.CommonMarkupOutputFormat<TemplateXMLOutputModel>
freemarker.core.XMLOutputFormat
freemarker.core.XHTMLOutputFormat
Represents the XML output format (MIME type "application/xhtml+xml", name "XHTML"); this behaves identically to
HTMLOutputFormat, except that the name an the MIME Type differs. Yet, it extends XMLOutputFormat,
as XHTML documents is a subset of XML documents, but not of HTML documents.
This class was final before 2.3.29.
- Since:
- 2.3.24
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic XHTMLOutputFormatThe 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 use 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 TemplateXHTMLOutputModelnewTemplateMarkupOutputModel(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 use 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.MarkupOutputFormat
outputForeignMethods inherited from class freemarker.core.OutputFormat
toString, toStringExtraProperties
-
Field Details
-
INSTANCE
The only instance (singleton) of thisOutputFormat.
-
-
Constructor Details
-
XHTMLOutputFormat
protected XHTMLOutputFormat()- Since:
- 2.3.29
-
-
Method Details
-
getName
Description copied from class:OutputFormatThe short name used to refer to this format (like in the#ftlheader).- Overrides:
getNamein classXMLOutputFormat
-
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.- Overrides:
getMimeTypein classXMLOutputFormat
-
output
Description copied from class:MarkupOutputFormatEquivalent to callingMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.output(TemplateMarkupOutputModel, Writer), but the implementation may use a more efficient solution.- Overrides:
outputin classXMLOutputFormat- Throws:
IOExceptionTemplateModelException
-
escapePlainText
Description copied from class:MarkupOutputFormatShould give the same result asMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel), but the implementation may use a more efficient solution.- Overrides:
escapePlainTextin classXMLOutputFormat
-
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.- Overrides:
isLegacyBuiltInBypassedin classXMLOutputFormat
-
newTemplateMarkupOutputModel
protected TemplateXHTMLOutputModel newTemplateMarkupOutputModel(String plainTextContent, String markupContent)Description copied from class:CommonMarkupOutputFormatCreates a newCommonTemplateMarkupOutputModelthat's bound to thisOutputFormatinstance. When this is called fromCommonMarkupOutputFormat, exactly one of the parameters will be non-null.- Overrides:
newTemplateMarkupOutputModelin classXMLOutputFormat- Parameters:
plainTextContent-nullif the content is markup that possibly can be described as plain text without loss.markupContent- Typically will benullifplainTextContentis notnull. While the plain text always can be converted to markup viaMarkupOutputFormat.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 whenCommonMarkupOutputFormat.getMarkupString(CommonTemplateMarkupOutputModel)is called).
-