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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.codehaus.jackson.map.ObjectMapper` | `mapper`
    `static org.codehaus.jackson.map.ObjectMapper` | `prettyMapper`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JsonSerialization()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> T` | `readValue(byte[] bytes, Class<T> type)`
    `static <T> T` | `readValue(InputStream bytes, Class<T> type)`
    `static <T> T` | `readValue(String bytes, Class<T> type)`
    `static byte[]` | `writeValueAsBytes(Object obj)`
    `static String` | `writeValueAsString(Object obj)`
    `static void` | `writeValueToStream(OutputStream os, Object obj)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### mapper

          public static final org.codehaus.jackson.map.ObjectMapper mapper

    - #### prettyMapper

          public static final org.codehaus.jackson.map.ObjectMapper prettyMapper

  - ### Constructor Detail

    - #### JsonSerialization

          public JsonSerialization()

  - ### Method Detail

    - #### writeValueToStream

          public static void writeValueToStream(OutputStream os,
                                Object obj)
                                         throws IOException

      Throws:
        `IOException`

    - #### writeValueAsString

          public static String writeValueAsString(Object obj)
                                           throws IOException

      Throws:
        `IOException`

    - #### writeValueAsBytes

          public static byte[] writeValueAsBytes(Object obj)
                                          throws IOException

      Throws:
        `IOException`

    - #### readValue

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

      Throws:
        `IOException`

    - #### readValue

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

      Throws:
        `IOException`

    - #### readValue

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

      Throws:
        `IOException`

Copyright © 2015. All Rights Reserved.