Package freemarker.core
Class RTFOutputFormat
- java.lang.Object
-
- freemarker.core.OutputFormat
-
- freemarker.core.MarkupOutputFormat<MO>
-
- freemarker.core.CommonMarkupOutputFormat<TemplateRTFOutputModel>
-
- freemarker.core.RTFOutputFormat
-
public class RTFOutputFormat extends CommonMarkupOutputFormat<TemplateRTFOutputModel>
Represents the Rich Text Format output format (MIME type "application/rtf", name "RTF"). This format escapes by default (viaStringUtil.RTFEnc(String)). The?rtfbuilt-in silently bypasses template output values of the type produced by this output format (TemplateRTFOutputModel).This class was final before 2.3.29.
- Since:
- 2.3.24
-
-
Field Summary
Fields Modifier and Type Field Description static RTFOutputFormatINSTANCEThe only instance (singleton) of thisOutputFormat.
-
Constructor Summary
Constructors Modifier Constructor Description protectedRTFOutputFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringescapePlainText(java.lang.String plainTextContent)Should give the same result asMarkupOutputFormat.fromPlainTextByEscaping(String)and thenMarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel), but the implementation may uses a more efficient solution.java.lang.StringgetMimeType()Returns the MIME type of the output format.java.lang.StringgetName()The short name used to refer to this format (like in the#ftlheader).booleanisLegacyBuiltInBypassed(java.lang.String builtInName)Tells if a string built-in that can't handle aTemplateMarkupOutputModelleft hand operand can bypass this object as is.protected TemplateRTFOutputModelnewTemplateMarkupOutputModel(java.lang.String plainTextContent, java.lang.String markupContent)Creates a newCommonTemplateMarkupOutputModelthat's bound to thisOutputFormatinstance.voidoutput(java.lang.String textToEsc, java.io.Writer out)Equivalent 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, output
-
Methods inherited from class freemarker.core.OutputFormat
toString, toStringExtraProperties
-
-
-
-
Field Detail
-
INSTANCE
public static final RTFOutputFormat INSTANCE
The only instance (singleton) of thisOutputFormat.
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:OutputFormatThe short name used to refer to this format (like in the#ftlheader).- Specified by:
getNamein classOutputFormat
-
getMimeType
public java.lang.String 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
public void output(java.lang.String textToEsc, java.io.Writer out) throws java.io.IOException, TemplateModelExceptionDescription 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<TemplateRTFOutputModel>- Throws:
java.io.IOExceptionTemplateModelException
-
escapePlainText
public java.lang.String escapePlainText(java.lang.String plainTextContent)
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<TemplateRTFOutputModel>
-
isLegacyBuiltInBypassed
public boolean isLegacyBuiltInBypassed(java.lang.String builtInName)
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<TemplateRTFOutputModel>
-
newTemplateMarkupOutputModel
protected TemplateRTFOutputModel newTemplateMarkupOutputModel(java.lang.String plainTextContent, java.lang.String markupContent)
Description copied from class:CommonMarkupOutputFormatCreates a newCommonTemplateMarkupOutputModelthat's bound to thisOutputFormatinstance.- Specified by:
newTemplateMarkupOutputModelin classCommonMarkupOutputFormat<TemplateRTFOutputModel>
-
-