JavaScriptEncoder (Grails 3.3.8)
Date: 2018-08-10

Package: org.grails.encoder.impl

## [Java] Class JavaScriptEncoder

- org.grails.encoder.impl.JavaScriptEncoder

- Used for making strings safe to be included in a SCRIPT tag besides normal Javascript escaping, possibly "unsafe" characters are escaped too so that it's safe to include an escaped string in a HTML SCRIPT tag.

  Authors:
    Lari Hotari
  Since:
    2.3

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static CodecIdentifier` | `JAVASCRIPT_CODEC_IDENTIFIER` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractCharReplacementEncoder` | `codecIdentifier`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `JavaScriptEncoder ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected java.lang.String` | `escapeCharacter(char ch, char previousChar)`
    `` | `boolean` | `isApplyToSafelyEncoded()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractCharReplacementEncoder` | `convertToString, createChainingEncodesToWriter, doCharReplacementEncoding, encode, encodeToStream, encodeToWriter, encodeToWriter, escapeCharSequence, escapeCharacter, getCodecIdentifier, isApplyToSafelyEncoded, isSafe, markEncoded`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### public static final CodecIdentifier JAVASCRIPT_CODEC_IDENTIFIER

  - ### Constructor Detail

    - #### public JavaScriptEncoder()

  - ### Method Detail

    - #### @java.lang.Override protected java.lang.String escapeCharacter(char ch, char previousChar)

    - #### @java.lang.Override public boolean isApplyToSafelyEncoded()