CommonTemplateMarkupOutputModel (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.core, class: CommonTemplateMarkupOutputModel

Package freemarker.core

# Class CommonTemplateMarkupOutputModel<MO extends CommonTemplateMarkupOutputModel<MO>>

java.lang.Object
freemarker.core.CommonTemplateMarkupOutputModel<MO>

All Implemented Interfaces:
  `TemplateMarkupOutputModel<MO>`, `TemplateModel`

Direct Known Subclasses:
  `TemplateCombinedMarkupOutputModel`, `TemplateHTMLOutputModel`, `TemplateRTFOutputModel`, `TemplateXMLOutputModel`

public abstract class CommonTemplateMarkupOutputModel<MO extends CommonTemplateMarkupOutputModel<MO>> extends Object implements TemplateMarkupOutputModel<MO>
Common superclass for implementing `TemplateMarkupOutputModel`-s that belong to a `CommonMarkupOutputFormat` subclass format.

Thread-safe after proper publishing. Calculated fields (typically, the markup calculated from plain text) might will be re-calculated for multiple times if accessed from multiple threads (this only affects performance, not functionality).

Since:
  2.3.24

- ## Field Summary

  ### Fields inherited from interface freemarker.template.TemplateModel

  `NOTHING`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `CommonTemplateMarkupOutputModel​(String plainTextContent, String markupContent)`
  A least one of the parameters must be non-`null`!

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract CommonMarkupOutputFormat<MO>`
  `getOutputFormat()`
  Returns the singleton `OutputFormat` object that implements the operations for the "markup output" value.
  `String`
  `toString()`
  Returns something like `"markup(format=HTML, markup=<p>foo</p>)"`; where the first parameter is `OutputFormat.getName()`, and the second is the content, that's prefixed with `markup=` or `plainText=`, depending on the way the content is internally stored.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CommonTemplateMarkupOutputModel

    protected CommonTemplateMarkupOutputModel​(String plainTextContent, String markupContent)
    A least one of the parameters must be non-`null`!

- ## Method Details

  - ### getOutputFormat

    public abstract CommonMarkupOutputFormat<MO> getOutputFormat()
    Description copied from interface: `TemplateMarkupOutputModel`
    Returns the singleton `OutputFormat` object that implements the operations for the "markup output" value.
    Specified by:
      `getOutputFormat` in interface `TemplateMarkupOutputModel<MO extends CommonTemplateMarkupOutputModel<MO>>`

  - ### toString

    public String toString()
    Returns something like `"markup(format=HTML, markup=<p>foo</p>)"`; where the first parameter is `OutputFormat.getName()`, and the second is the content, that's prefixed with `markup=` or `plainText=`, depending on the way the content is internally stored.
    Overrides:
      `toString` in class `Object`
    Since:
      2.3.29