public class JsonSerialization extends Object
Modifier and Type | Field and Description |
---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
mapper |
static com.fasterxml.jackson.databind.ObjectMapper |
prettyMapper |
static com.fasterxml.jackson.databind.ObjectMapper |
sysPropertiesAwareMapper |
Constructor and Description |
---|
JsonSerialization() |
Modifier and Type | Method and Description |
---|---|
static com.fasterxml.jackson.databind.node.ObjectNode |
createObjectNode() |
static com.fasterxml.jackson.databind.node.ObjectNode |
createObjectNode(Object pojo)
Creates an
ObjectNode based on the given pojo , copying all its properties to the resulting ObjectNode . |
static <T> T |
readValue(byte[] bytes,
Class<T> type) |
static <T> T |
readValue(InputStream bytes,
Class<T> type) |
static <T> T |
readValue(InputStream bytes,
Class<T> type,
boolean replaceSystemProperties) |
static <T> T |
readValue(InputStream bytes,
com.fasterxml.jackson.core.type.TypeReference<T> type) |
static <T> T |
readValue(String bytes,
Class<T> type) |
static <T> T |
readValue(String string,
com.fasterxml.jackson.core.type.TypeReference<T> type) |
static byte[] |
writeValueAsBytes(Object obj) |
static String |
writeValueAsPrettyString(Object obj) |
static String |
writeValueAsString(Object obj) |
static void |
writeValuePrettyToStream(OutputStream os,
Object obj) |
static void |
writeValueToStream(OutputStream os,
Object obj) |
public static final com.fasterxml.jackson.databind.ObjectMapper mapper
public static final com.fasterxml.jackson.databind.ObjectMapper prettyMapper
public static final com.fasterxml.jackson.databind.ObjectMapper sysPropertiesAwareMapper
public static void writeValueToStream(OutputStream os, Object obj) throws IOException
IOException
public static void writeValuePrettyToStream(OutputStream os, Object obj) throws IOException
IOException
public static String writeValueAsPrettyString(Object obj) throws IOException
IOException
public static String writeValueAsString(Object obj) throws IOException
IOException
public static byte[] writeValueAsBytes(Object obj) throws IOException
IOException
public static <T> T readValue(byte[] bytes, Class<T> type) throws IOException
IOException
public static <T> T readValue(String bytes, Class<T> type) throws IOException
IOException
public static <T> T readValue(InputStream bytes, Class<T> type) throws IOException
IOException
public static <T> T readValue(String string, com.fasterxml.jackson.core.type.TypeReference<T> type) throws IOException
IOException
public static <T> T readValue(InputStream bytes, com.fasterxml.jackson.core.type.TypeReference<T> type) throws IOException
IOException
public static <T> T readValue(InputStream bytes, Class<T> type, boolean replaceSystemProperties) throws IOException
IOException
public static com.fasterxml.jackson.databind.node.ObjectNode createObjectNode(Object pojo) throws IOException
ObjectNode
based on the given pojo
, copying all its properties to the resulting ObjectNode
.pojo
- a pojo which properties will be populates into the resulting a ObjectNode
ObjectNode
with all the properties from the given pojoIOException
- if the resulting a ObjectNode
can not be createdpublic static com.fasterxml.jackson.databind.node.ObjectNode createObjectNode()
Copyright © 2019 JBoss by Red Hat. All rights reserved.