freemarker.core

## Class UndefinedOutputFormat

- java.lang.Object
- - freemarker.core.OutputFormat
  - - freemarker.core.UndefinedOutputFormat

    public final class UndefinedOutputFormat
    extends OutputFormat

Represents the output format used when the template output format is undecided. This is the default output format if FreeMarker can't select anything more specific (see `Configuration.setTemplateConfigurations(freemarker.cache.TemplateConfigurationFactory)`). This format doesn't support auto-escaping (`Configuration.setAutoEscapingPolicy(int)`). It will print `TemplateMarkupOutputModel`-s as is (doesn't try to convert them).

Since:
  2.3.24
See Also:
  `PlainTextOutputFormat`

### Field Summary

Fields
`static UndefinedOutputFormat` `INSTANCE`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getMimeType()` Returns the MIME type of the output format.
`String` `getName()` The short name used to refer to this format (like in the `#ftl` header).
`boolean` `isOutputFormatMixingAllowed()` Tells if this output format allows inserting `TemplateMarkupOutputModel`-s of another output formats into it.

### Methods inherited from class freemarker.core.OutputFormat

`toString, toStringExtraProperties`

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

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

### Field Detail

#### INSTANCE

    public static final UndefinedOutputFormat INSTANCE

### Method Detail

#### isOutputFormatMixingAllowed

    public boolean isOutputFormatMixingAllowed()

Description copied from class: `OutputFormat`
Tells if this output format allows inserting `TemplateMarkupOutputModel`-s of another output formats into it. If `true`, the foreign `TemplateMarkupOutputModel` will be inserted into the output as is (like if the surrounding output format was the same). This is usually a bad idea allow, as such an event could indicate application bugs. If this method returns `false` (recommended), then FreeMarker will try to assimilate the inserted value by converting its format to this format, which will currently (2.3.24) cause exception, unless the inserted value is made by escaping plain text and the target format is non-escaping, in which case format conversion is trivially possible. (It's not impossible that conversions will be extended beyond this, if there will be demand for that.)

`true` value is used by `UndefinedOutputFormat`.

Specified by:
  `isOutputFormatMixingAllowed` in class `OutputFormat`

#### getName

    public String getName()

Description copied from class: `OutputFormat`
The short name used to refer to this format (like in the `#ftl` header).

Specified by:
  `getName` in class `OutputFormat`

#### getMimeType

    public String getMimeType()

Description copied from class: `OutputFormat`
Returns the MIME type of the output format. This might comes handy when generating a HTTP response. `null` if this output format doesn't clearly corresponds to a specific MIME type.

Specified by:
  `getMimeType` in class `OutputFormat`