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

Package freemarker.core

# Class JavaScriptOrJSONCFormat

java.lang.Object
freemarker.core.CFormat
freemarker.core.AbstractJSONLikeFormat
freemarker.core.JavaScriptOrJSONCFormat

public final class JavaScriptOrJSONCFormat extends AbstractJSONLikeFormat
"JavaScript or JSON" `CFormat`; for generating output that's compatible with both JSON and JavaScript. This format is therefore resilient against configuration mistakes, where we generate output in one language, but use the `CFormat` for the other. The small price to pay is that we can't utilize some language-specific opportunities to make the output a bit shorter, but that hardly matters in practice. This is the default of `Configurable.getCFormat()` starting from `incompatible_improvements` 2.3.32.

Experimental class! This class is too new, and might will change over time. Therefore, for now most methods are not exposed outside FreeMarker. The class itself and some members are exposed as they are needed for configuring FreeMarker.

Since:
  2.3.32
See Also:
  `JavaScriptCFormat`, `JSONCFormat`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static JavaScriptOrJSONCFormat`
  `INSTANCE`
  `static String`
  `NAME`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getName()`

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

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

- ## Field Details

  - ### NAME

    public static final String NAME
    See Also:
      Constant Field Values

  - ### INSTANCE

    public static final JavaScriptOrJSONCFormat INSTANCE

- ## Method Details

  - ### getName

    public String getName()
    Specified by:
      `getName` in class `CFormat`