Class JsonUtils

java.lang.Object
com.alibaba.dashscope.legacy_2x.utils.JsonUtils

@Deprecated public class JsonUtils extends Object
Deprecated.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.google.gson.Gson
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    fromJson(com.google.gson.JsonElement json, Type typeOfT)
    Deprecated.
     
    static <T> T
    fromJson(String obj, Class<T> clazz)
    Deprecated.
     
    static <T> T
    fromJson(String str, Type typeOfT)
    Deprecated.
     
    static <T> T
    fromJsonObject(com.google.gson.JsonElement jsonElement, Class<T> clazz)
    Deprecated.
     
    static com.google.gson.JsonObject
    merge(com.google.gson.JsonObject dest, com.google.gson.JsonObject src)
    Deprecated.
     
    static com.google.gson.JsonObject
    Deprecated.
     
    static com.google.gson.JsonObject
    parse(String jsonString)
    Deprecated.
     
    static com.google.gson.JsonElement
    parseReader(com.google.gson.stream.JsonReader reader)
    Deprecated.
    Returns the next value from the JSON stream as a parse tree.
    static com.google.gson.JsonElement
    Deprecated.
    Parses the specified JSON string into a parse tree
    static com.google.gson.JsonElement
    Deprecated.
    Parses the specified JSON string into a parse tree
    static String
    Deprecated.
     
    static com.google.gson.JsonArray
    Deprecated.
     
    static com.google.gson.JsonElement
    Deprecated.
     
    static com.google.gson.JsonObject
    Deprecated.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • gson

      public static final com.google.gson.Gson gson
      Deprecated.
  • Constructor Details

    • JsonUtils

      public JsonUtils()
      Deprecated.
  • Method Details

    • toJson

      public static String toJson(Object obj)
      Deprecated.
    • fromJson

      public static <T> T fromJson(String obj, Class<T> clazz)
      Deprecated.
    • fromJson

      public static <T> T fromJson(String str, Type typeOfT)
      Deprecated.
    • fromJson

      public static <T> T fromJson(com.google.gson.JsonElement json, Type typeOfT)
      Deprecated.
    • fromJsonObject

      public static <T> T fromJsonObject(com.google.gson.JsonElement jsonElement, Class<T> clazz)
      Deprecated.
    • toJsonArray

      public static com.google.gson.JsonArray toJsonArray(Object obj)
      Deprecated.
    • toJsonObject

      public static com.google.gson.JsonObject toJsonObject(Object obj)
      Deprecated.
    • toJsonElement

      public static com.google.gson.JsonElement toJsonElement(Object obj)
      Deprecated.
    • parse

      public static com.google.gson.JsonObject parse(String jsonString)
      Deprecated.
    • parseString

      public static com.google.gson.JsonElement parseString(String json) throws com.google.gson.JsonSyntaxException
      Deprecated.
      Parses the specified JSON string into a parse tree
      Parameters:
      json - JSON text
      Returns:
      a parse tree of JsonElements corresponding to the specified JSON
      Throws:
      com.google.gson.JsonParseException - if the specified text is not valid JSON
      com.google.gson.JsonSyntaxException
    • parseReader

      public static com.google.gson.JsonElement parseReader(Reader reader) throws com.google.gson.JsonIOException, com.google.gson.JsonSyntaxException
      Deprecated.
      Parses the specified JSON string into a parse tree
      Parameters:
      reader - JSON text
      Returns:
      a parse tree of JsonElements corresponding to the specified JSON
      Throws:
      com.google.gson.JsonParseException - if the specified text is not valid JSON
      com.google.gson.JsonIOException
      com.google.gson.JsonSyntaxException
    • parseReader

      public static com.google.gson.JsonElement parseReader(com.google.gson.stream.JsonReader reader) throws com.google.gson.JsonIOException, com.google.gson.JsonSyntaxException
      Deprecated.
      Returns the next value from the JSON stream as a parse tree.
      Parameters:
      reader - The json reader.
      Returns:
      The `JsonElement` of the reader.
      Throws:
      com.google.gson.JsonParseException - if there is an IOException or if the specified text is not valid JSON
      com.google.gson.JsonIOException
      com.google.gson.JsonSyntaxException
    • merge

      public static com.google.gson.JsonObject merge(com.google.gson.JsonObject dest, com.google.gson.JsonObject src)
      Deprecated.
    • parametersToJsonObject

      public static com.google.gson.JsonObject parametersToJsonObject(Map<String,Object> parameters)
      Deprecated.