public class RTFOutputFormat extends CommonMarkupOutputFormat<TemplateRTFOutputModel>
StringUtil.RTFEnc(String)
). The ?rtf
built-in silently bypasses template output values
of the type produced by this output format (TemplateRTFOutputModel
).
This class was final before 2.3.29.
Modifier and Type | Field and Description |
---|---|
static RTFOutputFormat |
INSTANCE
The only instance (singleton) of this
OutputFormat . |
Modifier | Constructor and Description |
---|---|
protected |
RTFOutputFormat() |
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 TemplateRTFOutputModel |
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, output
outputForeign
toString, toStringExtraProperties
public static final RTFOutputFormat INSTANCE
OutputFormat
.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 use a more efficient solution.output
in class CommonMarkupOutputFormat<TemplateRTFOutputModel>
java.io.IOException
TemplateModelException
public java.lang.String escapePlainText(java.lang.String plainTextContent)
MarkupOutputFormat
MarkupOutputFormat.fromPlainTextByEscaping(String)
and then
MarkupOutputFormat.getMarkupString(TemplateMarkupOutputModel)
, but the implementation may use a more efficient solution.escapePlainText
in class MarkupOutputFormat<TemplateRTFOutputModel>
public boolean isLegacyBuiltInBypassed(java.lang.String builtInName)
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<TemplateRTFOutputModel>
protected TemplateRTFOutputModel newTemplateMarkupOutputModel(java.lang.String plainTextContent, java.lang.String markupContent)
CommonMarkupOutputFormat
CommonTemplateMarkupOutputModel
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<TemplateRTFOutputModel>
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).