Package io.vertx.core.json.jackson

## Class JacksonCodec

- java.lang.Object
- - io.vertx.core.json.jackson.JacksonCodec

- All Implemented Interfaces:
    `JsonCodec`
  Direct Known Subclasses:
    `DatabindCodec`

      public class JacksonCodec
      extends Object
      implements JsonCodec

  Author:
    Julien Viet

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JacksonCodec()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static JsonParser` | `createParser​(Buffer buf)` |
    `static JsonParser` | `createParser​(String str)` |
    `static void` | `encodeJson​(Object json, JsonGenerator generator)` |
    `Object` | `fromBuffer​(Buffer buf)` |
    `<T> T` | `fromBuffer​(Buffer json, Class<T> clazz)` | Like `JsonCodec.fromString(String, Class)` but with a json `Buffer`
    `static <T> T` | `fromParser​(JsonParser parser, Class<T> type)` |
    `Object` | `fromString​(String str)` |
    `<T> T` | `fromString​(String json, Class<T> clazz)` | Decode the provide `json` string to an object extending `clazz`.
    `<T> T` | `fromValue​(Object json, Class<T> toValueType)` | Like `JsonCodec.fromString(String, Class)` but with a json `Object`
    `Buffer` | `toBuffer​(Object object, boolean pretty)` | Like `JsonCodec.toString(Object, boolean)` but with a json `Buffer`
    `String` | `toString​(Object object, boolean pretty)` | Encode the specified `object` to a string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.core.spi.json.JsonCodec

      `toBuffer, toString`

- - ### Constructor Detail

    - #### JacksonCodec

          public JacksonCodec()

  - ### Method Detail

    - #### fromString

          public <T> T fromString​(String json,
                                  Class<T> clazz)
                           throws DecodeException

      Description copied from interface: `JsonCodec`
      Decode the provide `json` string to an object extending `clazz`.
      Specified by:
        `fromString` in interface `JsonCodec`
      Parameters:
        `json` - the json string
        `clazz` - the required object's class
      Returns:
        the instance
      Throws:
        `DecodeException` - anything preventing the decoding

    - #### fromBuffer

          public <T> T fromBuffer​(Buffer json,
                                  Class<T> clazz)
                           throws DecodeException

      Description copied from interface: `JsonCodec`
      Like `JsonCodec.fromString(String, Class)` but with a json `Buffer`
      Specified by:
        `fromBuffer` in interface `JsonCodec`
      Throws:
        `DecodeException`

    - #### fromValue

          public <T> T fromValue​(Object json,
                                 Class<T> toValueType)

      Description copied from interface: `JsonCodec`
      Like `JsonCodec.fromString(String, Class)` but with a json `Object`
      Specified by:
        `fromValue` in interface `JsonCodec`

    - #### toString

          public String toString​(Object object,
                                 boolean pretty)
                          throws EncodeException

      Description copied from interface: `JsonCodec`
      Encode the specified `object` to a string.
      Specified by:
        `toString` in interface `JsonCodec`
      Parameters:
        `object` - the object to encode
        `pretty` - `true` to format the string prettily
      Returns:
        the json encoded string
      Throws:
        `EncodeException`

    - #### toBuffer

          public Buffer toBuffer​(Object object,
                                 boolean pretty)
                          throws EncodeException

      Description copied from interface: `JsonCodec`
      Like `JsonCodec.toString(Object, boolean)` but with a json `Buffer`
      Specified by:
        `toBuffer` in interface `JsonCodec`
      Throws:
        `EncodeException`

    - #### createParser

          public static JsonParser createParser​(String str)

    - #### createParser

          public static JsonParser createParser​(Buffer buf)

    - #### fromString

          public Object fromString​(String str)
                            throws DecodeException

      Throws:
        `DecodeException`

    - #### fromBuffer

          public Object fromBuffer​(Buffer buf)
                            throws DecodeException

      Throws:
        `DecodeException`

    - #### fromParser

          public static <T> T fromParser​(JsonParser parser,
                                         Class<T> type)
                                  throws DecodeException

      Throws:
        `DecodeException`

    - #### encodeJson

          public static void encodeJson​(Object json,
                                        JsonGenerator generator)
                                 throws EncodeException

      Throws:
        `EncodeException`