Package org.irods.irods4j.common
Class JsonUtil
java.lang.Object
org.irods.irods4j.common.JsonUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidstatic <T> TfromBytes(byte[] data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) static <T> Tstatic <T> TfromJsonString(String data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) static <T> TfromJsonString(String data, Class<T> clazz) static com.fasterxml.jackson.databind.ObjectMapperstatic com.fasterxml.jackson.databind.ObjectMappersetJsonMapper(com.fasterxml.jackson.databind.ObjectMapper other) static String
-
Constructor Details
-
JsonUtil
public JsonUtil()
-
-
Method Details
-
setJsonMapper
public static com.fasterxml.jackson.databind.ObjectMapper setJsonMapper(com.fasterxml.jackson.databind.ObjectMapper other) -
getJsonMapper
public static com.fasterxml.jackson.databind.ObjectMapper getJsonMapper() -
enablePrettyPrinting
public static void enablePrettyPrinting() -
disablePrettyPrinting
public static void disablePrettyPrinting() -
toJsonString
public static String toJsonString(Object o) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
fromJsonString
public static <T> T fromJsonString(String data, Class<T> clazz) throws com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
fromJsonString
public static <T> T fromJsonString(String data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
fromBytes
- Throws:
IOException
-
fromBytes
public static <T> T fromBytes(byte[] data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws IOException - Throws:
IOException
-