Package org.keycloak.util
Class JsonSerialization
- java.lang.Object
- 
- org.keycloak.util.JsonSerialization
 
- 
 public class JsonSerialization extends Object Utility class to handle simple JSON serializable for Keycloak.- Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Field SummaryFields Modifier and Type Field Description static com.fasterxml.jackson.databind.ObjectMappermapperstatic com.fasterxml.jackson.databind.ObjectMapperprettyMapperstatic com.fasterxml.jackson.databind.ObjectMappersysPropertiesAwareMapper
 - 
Constructor SummaryConstructors Constructor Description JsonSerialization()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static com.fasterxml.jackson.databind.node.ObjectNodecreateObjectNode()static com.fasterxml.jackson.databind.node.ObjectNodecreateObjectNode(Object pojo)Creates anObjectNodebased on the givenpojo, copying all its properties to the resultingObjectNode.static <T> TreadValue(byte[] bytes, Class<T> type)static <T> TreadValue(InputStream bytes, com.fasterxml.jackson.core.type.TypeReference<T> type)static <T> TreadValue(InputStream bytes, Class<T> type)static <T> TreadValue(InputStream bytes, Class<T> type, boolean replaceSystemProperties)static <T> TreadValue(String string, com.fasterxml.jackson.core.type.TypeReference<T> type)static <T> TreadValue(String bytes, Class<T> type)static byte[]writeValueAsBytes(Object obj)static StringwriteValueAsPrettyString(Object obj)static StringwriteValueAsString(Object obj)static voidwriteValuePrettyToStream(OutputStream os, Object obj)static voidwriteValueToStream(OutputStream os, Object obj)
 
- 
- 
- 
Method Detail- 
writeValueToStreampublic static void writeValueToStream(OutputStream os, Object obj) throws IOException - Throws:
- IOException
 
 - 
writeValuePrettyToStreampublic static void writeValuePrettyToStream(OutputStream os, Object obj) throws IOException - Throws:
- IOException
 
 - 
writeValueAsPrettyStringpublic static String writeValueAsPrettyString(Object obj) throws IOException - Throws:
- IOException
 
 - 
writeValueAsStringpublic static String writeValueAsString(Object obj) throws IOException - Throws:
- IOException
 
 - 
writeValueAsBytespublic static byte[] writeValueAsBytes(Object obj) throws IOException - Throws:
- IOException
 
 - 
readValuepublic static <T> T readValue(byte[] bytes, Class<T> type) throws IOException- Throws:
- IOException
 
 - 
readValuepublic static <T> T readValue(String bytes, Class<T> type) throws IOException - Throws:
- IOException
 
 - 
readValuepublic static <T> T readValue(InputStream bytes, Class<T> type) throws IOException - Throws:
- IOException
 
 - 
readValuepublic static <T> T readValue(String string, com.fasterxml.jackson.core.type.TypeReference<T> type) throws IOException - Throws:
- IOException
 
 - 
readValuepublic static <T> T readValue(InputStream bytes, com.fasterxml.jackson.core.type.TypeReference<T> type) throws IOException - Throws:
- IOException
 
 - 
readValuepublic static <T> T readValue(InputStream bytes, Class<T> type, boolean replaceSystemProperties) throws IOException - Throws:
- IOException
 
 - 
createObjectNodepublic static com.fasterxml.jackson.databind.node.ObjectNode createObjectNode(Object pojo) throws IOException Creates anObjectNodebased on the givenpojo, copying all its properties to the resultingObjectNode.- Parameters:
- pojo- a pojo which properties will be populates into the resulting a- ObjectNode
- Returns:
- a ObjectNodewith all the properties from the given pojo
- Throws:
- IOException- if the resulting a- ObjectNodecan not be created
 
 - 
createObjectNodepublic static com.fasterxml.jackson.databind.node.ObjectNode createObjectNode() 
 
- 
 
-