Class NoneEncoder

java.lang.Object
org.grails.encoder.impl.NoneEncoder
All Implemented Interfaces:
CodecIdentifierProvider, Encoder, StreamingEncoder

public class NoneEncoder extends Object implements StreamingEncoder
Since:
2.3
  • Constructor Details

    • NoneEncoder

      public NoneEncoder()
  • Method Details

    • encode

      public Object encode(Object o)
      Description copied from interface: Encoder
      Encode given input object
      Specified by:
      encode in interface Encoder
      Parameters:
      o - the input object
      Returns:
      the encoded object
    • isSafe

      public boolean isSafe()
      Description copied from interface: Encoder
      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.
      Specified by:
      isSafe in interface Encoder
      Returns:
      true, if is safe
    • isApplyToSafelyEncoded

      public boolean isApplyToSafelyEncoded()
      Specified by:
      isApplyToSafelyEncoded in interface Encoder
      Returns:
      true if this this codec should be applied to a buffer part that is already encoded with a safe encoder
    • markEncoded

      public void markEncoded(CharSequence string)
      Description copied from interface: Encoder
      Mark this instance as encoded with this encoder in the current EncodingStateRegistry
      Specified by:
      markEncoded in interface Encoder
      Parameters:
      string - a CharSequence to mark as encoded
    • getCodecIdentifier

      public CodecIdentifier getCodecIdentifier()
      Description copied from interface: CodecIdentifierProvider
      Gets the codec identifier information.
      Specified by:
      getCodecIdentifier in interface CodecIdentifierProvider
      Returns:
      the codec identifier information
    • encodeToStream

      public void encodeToStream(Encoder thisInstance, CharSequence source, int offset, int len, EncodedAppender appender, EncodingState encodingState) throws IOException
      Description copied from interface: StreamingEncoder
      Encode and append portion of source CharSequence to the appender.
      Specified by:
      encodeToStream in interface StreamingEncoder
      source - The source CharSequence
      offset - Offset from which to start encoding characters
      len - Number of characters to encode
      appender - the appender to write to
      encodingState - the current encoding state
      Throws:
      IOException - Signals that an I/O exception has occurred.