Top Description Fields Constructors Methods
org.keycloak.util

public Class JsonSerialization

extends Object
Class Inheritance
Imports
com.fasterxml.jackson.annotation.JsonInclude, com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.core.type.TypeReference, com.fasterxml.jackson.databind.JsonNode, .ObjectMapper, .SerializationFeature, com.fasterxml.jackson.databind.node.ObjectNode, java.io.IOException, .InputStream, .OutputStream

Utility class to handle simple JSON serializable for Keycloak.
Author
Bill Burke
Version
$Revision: 1 $

Field Summary

Modifier and TypeField and Description
public static final ObjectMapper
public static final ObjectMapper
public static final ObjectMapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static ObjectNode

Returns:

a ObjectNode with all the properties from the given pojo
createObjectNode
(Object
a pojo which properties will be populates into the resulting a ObjectNode
pojo
)

Creates an ObjectNode based on the given pojo, copying all its properties to the resulting ObjectNode.

public static ObjectNode
public static <T> T
readValue(byte[] bytes, Class<T> type)

public static <T> T
readValue(String bytes, Class<T> type)

public static <T> T
readValue(InputStream bytes, Class<T> type)

public static <T> T
readValue(String string, TypeReference<T> type)

public static <T> T
public static <T> T
readValue(InputStream bytes, Class<T> type, boolean replaceSystemProperties)

public static byte[]
public static String
public static String
public static void
public static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapperback to summary
public static final ObjectMapper mapper
prettyMapperback to summary
public static final ObjectMapper prettyMapper
sysPropertiesAwareMapperback to summary
public static final ObjectMapper sysPropertiesAwareMapper

Constructor Detail

JsonSerializationback to summary
public JsonSerialization()

Method Detail

createObjectNodeback to summary
public static ObjectNode createObjectNode(Object pojo) throws IOException

Creates an ObjectNode based on the given pojo, copying all its properties to the resulting ObjectNode.

Parameters
pojo:Object

a pojo which properties will be populates into the resulting a ObjectNode

Returns:ObjectNode

a ObjectNode with all the properties from the given pojo

Exceptions
IOException:
if the resulting a ObjectNode can not be created
createObjectNodeback to summary
public static ObjectNode createObjectNode()
readValueback to summary
public static <T> T readValue(byte[] bytes, Class<T> type) throws IOException
readValueback to summary
public static <T> T readValue(String bytes, Class<T> type) throws IOException
readValueback to summary
public static <T> T readValue(InputStream bytes, Class<T> type) throws IOException
readValueback to summary
public static <T> T readValue(String string, TypeReference<T> type) throws IOException
readValueback to summary
public static <T> T readValue(InputStream bytes, TypeReference<T> type) throws IOException
readValueback to summary
public static <T> T readValue(InputStream bytes, Class<T> type, boolean replaceSystemProperties) throws IOException
writeValueAsBytesback to summary
public static byte[] writeValueAsBytes(Object obj) throws IOException
writeValueAsPrettyStringback to summary
public static String writeValueAsPrettyString(Object obj) throws IOException
writeValueAsStringback to summary
public static String writeValueAsString(Object obj) throws IOException
writeValuePrettyToStreamback to summary
public static void writeValuePrettyToStream(OutputStream os, Object obj) throws IOException
writeValueToStreamback to summary
public static void writeValueToStream(OutputStream os, Object obj) throws IOException