Modifier and Type | Field and Description |
---|---|
private static com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
private static com.fasterxml.jackson.databind.ObjectWriter |
prettyWriter |
private static com.fasterxml.jackson.databind.ObjectWriter |
writer |
Modifier and Type | Method and Description |
---|---|
static <T> T |
fromJsonString(java.lang.String json,
java.lang.Class<T> clazz)
Returns the deserialized object from the given json string and target
class; or null if the given json string is null.
|
static com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
static com.fasterxml.jackson.databind.ObjectWriter |
getPrettywriter() |
static com.fasterxml.jackson.databind.ObjectWriter |
getWriter() |
static com.fasterxml.jackson.core.JsonGenerator |
jsonGeneratorOf(java.io.Writer writer) |
static com.fasterxml.jackson.databind.JsonNode |
jsonNodeOf(java.lang.String json) |
static <T> T |
loadFrom(java.io.File file,
java.lang.Class<T> clazz) |
static java.lang.String |
toJsonPrettyString(java.lang.Object value) |
static java.lang.String |
toJsonString(java.lang.Object value) |
static Jackson |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Jackson[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
private static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
private static final com.fasterxml.jackson.databind.ObjectWriter writer
private static final com.fasterxml.jackson.databind.ObjectWriter prettyWriter
public static Jackson[] values()
for (Jackson c : Jackson.values()) System.out.println(c);
public static Jackson valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static java.lang.String toJsonPrettyString(java.lang.Object value)
public static java.lang.String toJsonString(java.lang.Object value)
public static <T> T fromJsonString(java.lang.String json, java.lang.Class<T> clazz)
public static com.fasterxml.jackson.databind.JsonNode jsonNodeOf(java.lang.String json)
public static com.fasterxml.jackson.core.JsonGenerator jsonGeneratorOf(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public static <T> T loadFrom(java.io.File file, java.lang.Class<T> clazz) throws java.io.IOException
java.io.IOException
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public static com.fasterxml.jackson.databind.ObjectWriter getWriter()
public static com.fasterxml.jackson.databind.ObjectWriter getPrettywriter()