EncodingStateRegistry (Grails 2.3.8)
Date: 2014-04-24

Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.codehaus.groovy.grails.support.encoding
[Java] Interface EncodingStateRegistry

    public interface EncodingStateRegistry

EncodingStateRegistry keeps encoding state of CharSequence instances. Encoding state information is required for the solution that prevents double-encoding a value that is already encoded. In the current implementation, a single EncodingStateRegistry instance is bound to a HTTP request life cycle.

Authors:
  Lari Hotari

Since:
  2.3

Method Summary
`EncodingState` | `getEncodingStateFor(java.lang.CharSequence string)` Gets the current encoding state for a CharSequence.
`boolean` | `isEncodedWith(Encoder encoder, java.lang.CharSequence string)` Checks if the CharSequence is encoded with encoder.
`void` | `registerEncodedWith(Encoder encoder, java.lang.CharSequence escaped)` Registers that the CharSequence has been encoded with encoder
`boolean` | `shouldEncodeWith(Encoder encoderToApply, java.lang.CharSequence string)` Checks if a encoder should be applied to a CharSequence

Method Detail

### getEncodingStateFor

    public EncodingState getEncodingStateFor(java.lang.CharSequence string)

  Gets the current encoding state for a CharSequence.
  Parameters:
    `string` - a CharSequence
  Returns:
    the encoding state for the CharSequence

### isEncodedWith

    public boolean isEncodedWith(Encoder encoder, java.lang.CharSequence string)

  Checks if the CharSequence is encoded with encoder.
  Parameters:
    `encoder` - the encoder
    `string` - a CharSequence
  Returns:
    true, if it is encoded with encoder

### registerEncodedWith

    public void registerEncodedWith(Encoder encoder, java.lang.CharSequence escaped)

  Registers that the CharSequence has been encoded with encoder
  Parameters:
    `encoder` - the encoder
    `escaped` - the CharSequence

### shouldEncodeWith

    public boolean shouldEncodeWith(Encoder encoderToApply, java.lang.CharSequence string)

  Checks if a encoder should be applied to a CharSequence
  Parameters:
    `encoderToApply` - the encoder to apply
    `string` - a CharSequence
  Returns:
    true, if it should be applied

Groovy Documentation