public abstract class Serializer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Serializer.DataSerializer |
static class |
Serializer.DateDeserializer |
static class |
Serializer.DateSerializer |
static class |
Serializer.LocalDateTimeDeserializer |
static class |
Serializer.LocalDateTimeSerializer |
static class |
Serializer.SerializerException |
| Modifier and Type | Field and Description |
|---|---|
protected static com.fasterxml.jackson.databind.json.JsonMapper |
jsonMapper |
protected static com.fasterxml.jackson.dataformat.xml.XmlMapper |
xmlMapper |
protected static com.fasterxml.jackson.dataformat.yaml.YAMLMapper |
yamlMapper |
| Constructor and Description |
|---|
Serializer() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
addSerializer(Class<? extends T> type,
Function<T,Object> function) |
protected static void |
configure(com.fasterxml.jackson.databind.ObjectMapper mapper) |
static Object |
fromJson(String json) |
static <T> T |
fromJson(String json,
Class<T> type) |
static <T> T |
fromMap(Map<String,Object> map,
Class<T> type) |
static Object |
fromXml(String xml) |
static <T> T |
fromXml(String xml,
Class<T> type) |
static Object |
fromYaml(String yaml) |
static <T> T |
fromYaml(String yaml,
Class<T> type) |
static com.fasterxml.jackson.databind.json.JsonMapper |
jsonMapper() |
protected static com.fasterxml.jackson.databind.module.SimpleModule |
module() |
static byte[] |
toBytes(Serializable object) |
static <T> T |
toClass(Class<T> type,
byte[] bytes) |
static String |
toJson(Object object) |
static String |
toJsonSingleLine(Object object) |
static Map<String,Object> |
toMap(Object object) |
static Object |
toObject(byte[] bytes) |
static String |
toXml(Object object,
String root) |
static String |
toXmlSingleLine(Object object,
String root) |
static String |
toYaml(Object object) |
protected static com.fasterxml.jackson.databind.json.JsonMapper jsonMapper
protected static com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper
protected static com.fasterxml.jackson.dataformat.yaml.YAMLMapper yamlMapper
protected static void configure(com.fasterxml.jackson.databind.ObjectMapper mapper)
protected static com.fasterxml.jackson.databind.module.SimpleModule module()
public static <T> void addSerializer(Class<? extends T> type, Function<T,Object> function)
public static com.fasterxml.jackson.databind.json.JsonMapper jsonMapper()
public static byte[] toBytes(Serializable object)
public static <T> T toClass(Class<T> type, byte[] bytes)
public static Object toObject(byte[] bytes)
Copyright © 2023. All rights reserved.