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

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

## org.codehaus.groovy.grails.plugins.codecs
[Java] Class AbstractCharReplacementEncoder

    java.lang.Object
      org.codehaus.groovy.grails.plugins.codecs.AbstractCharReplacementEncoder

All Implemented Interfaces:
  Encoder, StreamingEncoder, StreamingStatelessEncoder

    public abstract class AbstractCharReplacementEncoder
    extends java.lang.Object

Abstract base class for implementing encoders that do character replacements Implements the StreamingEncoder interface that enables efficient streaming encoding

Authors:
  Lari Hotari

Since:
  2.3

Field Summary
`protected CodecIdentifier` | `codecIdentifier`

Constructor Summary
`AbstractCharReplacementEncoder(CodecIdentifier codecIdentifier)`

Method Summary
`protected java.lang.String` | `convertToString(java.lang.Object o)`
`protected java.lang.Object` | `doCharReplacementEncoding(java.lang.Object o)`
`java.lang.Object` | `encode(java.lang.Object o)`
`void` | `encodeToStream(Encoder thisInstance, java.lang.CharSequence str, int off, int len, EncodedAppender appender, EncodingState encodingState)`
`void` | `encodeToWriter(java.lang.CharSequence str, java.io.Writer writer)`
`protected java.lang.Object` | `escapeCharSequence(java.lang.CharSequence str)`
`protected java.lang.String` | `escapeCharacter(char ch, char previousChar)` Escape the character, return null if no replacement has to be made
`CodecIdentifier` | `getCodecIdentifier()`
`boolean` | `isApplyToSafelyEncoded()`
`boolean` | `isSafe()`
`void` | `markEncoded(java.lang.CharSequence string)`

Methods inherited from 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

### codecIdentifier

    protected CodecIdentifier codecIdentifier

Constructor Detail

### AbstractCharReplacementEncoder

    public AbstractCharReplacementEncoder(CodecIdentifier codecIdentifier)

Method Detail

### convertToString

    protected java.lang.String convertToString(java.lang.Object o)

### doCharReplacementEncoding

    protected final java.lang.Object doCharReplacementEncoding(java.lang.Object o)

### encode

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

### encodeToStream

    public void encodeToStream(Encoder thisInstance, java.lang.CharSequence str, int off, int len, EncodedAppender appender, EncodingState encodingState)

### encodeToWriter

    public void encodeToWriter(java.lang.CharSequence str, java.io.Writer writer)

### escapeCharSequence

    protected java.lang.Object escapeCharSequence(java.lang.CharSequence str)

### escapeCharacter

    protected java.lang.String escapeCharacter(char ch, char previousChar)

  Escape the character, return null if no replacement has to be made
  Parameters:
    `ch` - the character to escape
    `previousChar` - the previous char
  Returns:
    the replacement string, null if no replacement has to be made

### getCodecIdentifier

    public CodecIdentifier getCodecIdentifier()

### isApplyToSafelyEncoded

    public boolean isApplyToSafelyEncoded()

### isSafe

    public boolean isSafe()

### markEncoded

    public void markEncoded(java.lang.CharSequence string)

Groovy Documentation