Package org.springframework.ai.util.json
Class JsonParser
java.lang.Object
org.springframework.ai.util.json.JsonParser
Utilities to perform parsing operations between JSON and Java.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Converts a JSON string to a Java object.static <T> T
Converts a JSON string to a Java object.static com.fasterxml.jackson.databind.ObjectMapper
Returns a JacksonObjectMapper
instance tailored for JSON-parsing operations for tool calling and structured output.static String
Converts a Java object to a JSON string.static Object
toTypedObject
(Object value, Class<?> type) Convert a Java Object to a typed Object.
-
Method Details
-
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Returns a JacksonObjectMapper
instance tailored for JSON-parsing operations for tool calling and structured output. -
fromJson
Converts a JSON string to a Java object. -
fromJson
Converts a JSON string to a Java object. -
toJson
Converts a Java object to a JSON string. -
toTypedObject
Convert a Java Object to a typed Object. Based on the implementation in MethodInvokingFunctionCallback.
-