类 JsonUtils
java.lang.Object
com.baidu.mochow.util.JsonUtils
JsonUtils for Serialization and deserialization of JSON
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <T> TfromJsonString(String json, Class<T> clazz) Returns the deserialized object from the given json string and target class; or null if the given json string is null.static com.fasterxml.jackson.databind.ObjectMapperstatic voidload(InputStream input, Object obj) static <T> Tstatic <T> TloadFrom(InputStream input, Class<T> clazz) static StringtoJsonPrettyString(Object value) static StringtoJsonString(Object value)
-
构造器详细资料
-
JsonUtils
public JsonUtils()
-
-
方法详细资料
-
toJsonPrettyString
public static String toJsonPrettyString(Object value) throws com.fasterxml.jackson.core.JsonProcessingException - 抛出:
com.fasterxml.jackson.core.JsonProcessingException
-
toJsonString
-
fromJsonString
Returns the deserialized object from the given json string and target class; or null if the given json string is null. -
loadFrom
- 抛出:
IOException
-
loadFrom
public static <T> T loadFrom(InputStream input, Class<T> clazz) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException - 抛出:
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOException
-
load
public static void load(InputStream input, Object obj) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - 抛出:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-