public class DatabindCodec extends JacksonCodec
| Constructor and Description |
|---|
DatabindCodec() |
| Modifier and Type | Method and Description |
|---|---|
static JsonParser |
createParser(Buffer buf) |
static JsonParser |
createParser(String str) |
<T> T |
fromBuffer(Buffer buf,
Class<T> clazz)
Like
JsonCodec.fromString(String, Class) but with a json Buffer |
<T> T |
fromBuffer(Buffer buf,
TypeReference<T> typeRef) |
static <T> T |
fromParser(JsonParser parser,
Class<T> type) |
<T> T |
fromString(String str,
Class<T> clazz)
Decode the provide
json string to an object extending clazz. |
<T> T |
fromString(String str,
TypeReference<T> typeRef) |
<T> T |
fromValue(Object json,
Class<T> clazz)
Like
JsonCodec.fromString(String, Class) but with a json Object |
<T> T |
fromValue(Object json,
TypeReference<T> type) |
static ObjectMapper |
mapper() |
static ObjectMapper |
prettyMapper() |
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. |
decodeValue, decodeValue, fromBuffer, fromStringpublic static ObjectMapper mapper()
ObjectMapper used for data binding.public static ObjectMapper prettyMapper()
ObjectMapper used for data binding configured for indenting output.public <T> T fromValue(Object json, Class<T> clazz)
JsonCodecJsonCodec.fromString(String, Class) but with a json ObjectfromValue in interface JsonCodecfromValue in class JacksonCodecpublic <T> T fromValue(Object json, TypeReference<T> type)
fromValue in class JacksonCodecpublic <T> T fromString(String str, Class<T> clazz) throws DecodeException
JsonCodecjson string to an object extending clazz.fromString in interface JsonCodecfromString in class JacksonCodecstr - the json stringclazz - the required object's classDecodeException - anything preventing the decodingpublic <T> T fromString(String str, TypeReference<T> typeRef) throws DecodeException
fromString in class JacksonCodecDecodeExceptionpublic <T> T fromBuffer(Buffer buf, Class<T> clazz) throws DecodeException
JsonCodecJsonCodec.fromString(String, Class) but with a json BufferfromBuffer in interface JsonCodecfromBuffer in class JacksonCodecDecodeExceptionpublic <T> T fromBuffer(Buffer buf, TypeReference<T> typeRef) throws DecodeException
fromBuffer in class JacksonCodecDecodeExceptionpublic static JsonParser createParser(Buffer buf)
public static JsonParser createParser(String str)
public static <T> T fromParser(JsonParser parser, Class<T> type) throws DecodeException
DecodeExceptionpublic String toString(Object object, boolean pretty) throws EncodeException
JsonCodecobject to a string.toString in interface JsonCodectoString in class JacksonCodecobject - the object to encodepretty - true to format the string prettilyEncodeExceptionpublic Buffer toBuffer(Object object, boolean pretty) throws EncodeException
JsonCodecJsonCodec.toString(Object, boolean) but with a json BuffertoBuffer in interface JsonCodectoBuffer in class JacksonCodecEncodeExceptionCopyright © 2022 Eclipse. All rights reserved.