Class JsonUtil

java.lang.Object
fr.paris.lutece.util.json.JsonUtil

public class JsonUtil extends Object
JsonUtil
  • Field Details

  • Method Details

    • buildJsonResponse

      public static String buildJsonResponse(AbstractJsonResponse jsonResponse)
      return a string containing the JSON flow
      Parameters:
      jsonResponse - the JSON Response Object
      Returns:
      return a string containing the JSON flow
    • deserialize

      public static <T> T deserialize(String requestBody, Class<T> targetType) throws com.fasterxml.jackson.core.JsonProcessingException
      Deserialize a JSON string into an object of the specified type.
      Type Parameters:
      T - the type of the object
      Parameters:
      requestBody - the JSON string to deserialize
      targetType - the class of the object to deserialize into
      Returns:
      the deserialized object
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if there is an error during deserialization
    • serialize

      public static String serialize(Object objectValue) throws com.fasterxml.jackson.core.JsonProcessingException
      Serialize an object to a JSON string.
      Parameters:
      objectValue -
      Returns:
      a JSON string representation of the object
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException