Class JsonHelper

java.lang.Object
co.featbit.commons.json.JsonHelper

public abstract class JsonHelper extends Object
serialize or deserialize ffc object to/from json this class is only for internal use
  • Method Details

    • deserialize

      public static <T> T deserialize(String json, Class<T> objectClass) throws JsonParseException
      deserialize ffc object from json
      Type Parameters:
      T -
      Parameters:
      json - json string
      objectClass - object class
      Returns:
      a ffc object
      Throws:
      JsonParseException
    • deserialize

      public static <T> T deserialize(String json, Type type) throws JsonParseException
      deserialize ffc object from json
      Type Parameters:
      T -
      Parameters:
      json - json string
      type - object type
      Returns:
      a ffc object
      Throws:
      JsonParseException
    • deserialize

      public static <T> T deserialize(Reader reader, Class<T> objectClass) throws JsonParseException
      deserialize ffc object from Json Reader
      Type Parameters:
      T -
      Parameters:
      reader - Json Reader
      objectClass - object class
      Returns:
      a ffc object
      Throws:
      JsonParseException
    • deserialize

      public static <T> T deserialize(Reader reader, Type type) throws JsonParseException
      deserialize ffc object from Json Reader
      Type Parameters:
      T -
      Parameters:
      reader - Json Reader
      type - object type
      Returns:
      a ffc object
      Throws:
      JsonParseException
    • serialize

      public static String serialize(Object o)
      serialize to json
      Parameters:
      o - ffc object
      Returns:
      a json string