JSONEncoder (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 JSONEncoder

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

    public class JSONEncoder
    extends AbstractCharReplacementEncoder

Escapes characters in JSON output

Authors:
  Lari Hotari

Since:
  2.3.4

Field Summary
`static CodecIdentifier` | `JSON_CODEC_IDENTIFIER`

Fields inherited from class AbstractCharReplacementEncoder
codecIdentifier

Constructor Summary
`JSONEncoder()`

Method Summary
`protected java.lang.Object` | `doEncode(java.lang.Object o)`
`java.lang.Object` | `encode(java.lang.Object o)`
`protected java.lang.Object` | `encodeToJsonString(java.lang.Object o)`
`protected java.lang.String` | `escapeCharacter(char ch, char previousChar)`
`boolean` | `isApplyToSafelyEncoded()`

Methods inherited from class AbstractCharReplacementEncoder
convertToString, doCharReplacementEncoding, encode, encodeToStream, encodeToWriter, escapeCharSequence, escapeCharacter, getCodecIdentifier, isApplyToSafelyEncoded, isSafe, markEncoded

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

### JSON_CODEC_IDENTIFIER

    public static final CodecIdentifier JSON_CODEC_IDENTIFIER

Constructor Detail

### JSONEncoder

    public JSONEncoder()

Method Detail

### doEncode

    protected java.lang.Object doEncode(java.lang.Object o)

### encode

    @java.lang.Overrideif(o == null) {
    public final java.lang.Object encode(java.lang.Object o)

### encodeToJsonString

    protected java.lang.Object encodeToJsonString(java.lang.Object o)

### escapeCharacter

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

### isApplyToSafelyEncoded

    @java.lang.Overridepublic final Object encode(Object o) {
    public boolean isApplyToSafelyEncoded()

Groovy Documentation