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 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
IOExceptionpublic static void writeValuePrettyToStream(OutputStream os, Object obj) throws IOException
IOExceptionpublic static String writeValueAsPrettyString(Object obj) throws IOException
IOExceptionpublic static String writeValueAsString(Object obj) throws IOException
IOExceptionpublic static byte[] writeValueAsBytes(Object obj) throws IOException
IOExceptionpublic static <T> T readValue(byte[] bytes,
Class<T> type)
throws IOException
IOExceptionpublic static <T> T readValue(String bytes, Class<T> type) throws IOException
IOExceptionpublic static <T> T readValue(InputStream bytes, Class<T> type) throws IOException
IOExceptionpublic static <T> T readValue(InputStream bytes, com.fasterxml.jackson.core.type.TypeReference<T> type) throws IOException
IOExceptionpublic static <T> T readValue(InputStream bytes, Class<T> type, boolean replaceSystemProperties) throws IOException
IOExceptionpublic 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 ObjectNodeObjectNode 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 © 2017 JBoss by Red Hat. All rights reserved.