Class JsonParser

java.lang.Object
org.springframework.ai.util.json.JsonParser

@Deprecated(forRemoval=true) public final class JsonParser extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use JacksonUtils or JsonHelper instead
Utilities to perform parsing operations between JSON and Java.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> @Nullable T
    fromJson(String json, Class<T> type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use JsonHelper.fromJson(String, Class) instead
    static <T> @Nullable T
    fromJson(String json, Type type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use JsonHelper.fromJson(String, Type) instead
    static <T> @Nullable T
    fromJson(String json, tools.jackson.core.type.TypeReference<T> type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use JsonHelper.fromJson(String, org.springframework.core.ParameterizedTypeReference) instead
    static tools.jackson.databind.json.JsonMapper
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use JacksonUtils.getDefaultJsonMapper() instead
    static String
    toJson(@Nullable Object object)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use JsonHelper.toJson(Object, boolean) instead
    static Object
    toTypedObject(Object value, Class<?> type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use JsonHelper.convertToTypedObject(java.lang.Object, java.lang.Class<?>) instead

    Methods inherited from class java.lang.Object

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

    • getJsonMapper

      @Deprecated(forRemoval=true) public static tools.jackson.databind.json.JsonMapper getJsonMapper()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use JacksonUtils.getDefaultJsonMapper() instead
      Returns a Jackson JsonMapper instance tailored for JSON-parsing operations for tool calling and structured output.
    • fromJson

      @Deprecated(forRemoval=true) public static <T> @Nullable T fromJson(String json, Class<T> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use JsonHelper.fromJson(String, Class) instead
      Converts a JSON string to a Java object.
    • fromJson

      @Deprecated(forRemoval=true) public static <T> @Nullable T fromJson(String json, Type type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use JsonHelper.fromJson(String, Type) instead
      Converts a JSON string to a Java object.
    • fromJson

      @Deprecated(forRemoval=true) public static <T> @Nullable T fromJson(String json, tools.jackson.core.type.TypeReference<T> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use JsonHelper.fromJson(String, org.springframework.core.ParameterizedTypeReference) instead
      Converts a JSON string to a Java object.
    • toJson

      @Deprecated(forRemoval=true) public static String toJson(@Nullable Object object)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use JsonHelper.toJson(Object, boolean) instead
      Converts a Java object to a JSON string if it's not already a valid JSON string.
    • toTypedObject

      @Deprecated(forRemoval=true) public static Object toTypedObject(Object value, Class<?> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use JsonHelper.convertToTypedObject(java.lang.Object, java.lang.Class<?>) instead
      Convert a Java Object to a typed Object. Based on the implementation in MethodToolCallback.