Encoder (Grails 6.0.0)

Package: org.grails.encoder

## [Java] Interface Encoder

- org.grails.encoder.CodecIdentifierProvider

- All Superinterfaces:
    CodecIdentifierProvider

      public interface Encoder
      extends CodecIdentifierProvider

  Interface for encoding methods.

  Authors:
    Lari Hotari
  Since:
    2.3

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public java.lang.Object` | `encode(java.lang.Object o)` Encode given input object
    `` | `public boolean` | `isApplyToSafelyEncoded()` Returns: `true` if this this codec should be applied to a buffer part that is already encoded with a safe encoder
    `` | `public boolean` | `isSafe()` Checks if this encoder is XSS "safe".
    `` | `public void` | `markEncoded(java.lang.CharSequence string)` Mark this instance as encoded with this encoder in the current EncodingStateRegistry

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface CodecIdentifierProvider` | `getCodecIdentifier`

- - ### Method Detail

    - #### public java.lang.Object encode(java.lang.Object o)

      Encode given input object

      Parameters:
        `o` - the input object
      Returns:
        the encoded object

    - #### public boolean isApplyToSafelyEncoded()

      Returns:
        `true` if this this codec should be applied to a buffer part that is already encoded with a safe encoder

    - #### public boolean isSafe()

      Checks if this encoder is XSS "safe". This means that after appling this encoder, the characters have been escaped and are XSS safe to be included in HTML documents.

      Returns:
        true, if is safe

    - #### public void markEncoded(java.lang.CharSequence string)

      Mark this instance as encoded with this encoder in the current EncodingStateRegistry

      Parameters:
        `string` - a CharSequence to mark as encoded