com.bstek.dorado.data
public final class JsonUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATA_PROPERTY |
static java.lang.String |
DATATYPE_PROPERTY |
static java.lang.String |
ENTITY_ID_PROPERTY |
static java.lang.String |
OLD_DATA_PROPERTY |
static java.lang.String |
STATE_PROPERTY |
static java.lang.String |
WRAPPER_PROPERTY |
Modifier and Type | Method and Description |
---|---|
static <T> T |
get(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
java.lang.Class<T> classType) |
static <T> T |
get(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
org.codehaus.jackson.type.TypeReference valueTypeRef) |
static boolean |
getBoolean(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property) |
static boolean |
getBoolean(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
boolean defaultValue) |
static DataType |
getDataType(java.lang.String dataTypeName,
JsonConvertContext context) |
static java.util.Date |
getDate(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property) |
static java.util.Date |
getDate(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
java.util.Date defaultValue) |
static double |
getDouble(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property) |
static double |
getDouble(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
double defaultValue) |
static float |
getFloat(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property) |
static float |
getFloat(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
float defaultValue) |
static int |
getInt(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property) |
static int |
getInt(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
int defaultValue) |
static long |
getLong(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property) |
static long |
getLong(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
long defaultValue) |
static org.codehaus.jackson.map.ObjectMapper |
getObjectMapper() |
static java.lang.String |
getString(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property) |
static java.lang.String |
getString(org.codehaus.jackson.node.ObjectNode objectNode,
java.lang.String property,
java.lang.String defaultValue) |
static java.lang.Object |
toJavaObject(org.codehaus.jackson.JsonNode jsonNode,
DataType dataType)
尝试将一个JSON数据对象转换成Java POJO对象。
如果在转换的同时还指定了目标数据类型,那么此过程会尝试把JSON数据转换成与目标数据类型相匹配的Java POJO对象。 |
static java.lang.Object |
toJavaObject(org.codehaus.jackson.JsonNode jsonNode,
DataType dataType,
boolean proxy)
尝试将一个JSON数据对象转换成Java POJO对象。
如果在转换的同时还指定了目标数据类型,那么此过程会尝试把JSON数据转换成与目标数据类型相匹配的Java POJO对象。 |
static java.lang.Object |
toJavaObject(org.codehaus.jackson.JsonNode jsonNode,
DataType dataType,
java.lang.Class<?> targetType,
boolean proxy,
JsonConvertContext context)
尝试将一个JSON数据对象转换成Java POJO对象。
如果在转换的同时还指定了目标数据类型,那么此过程会尝试把JSON数据转换成与目标数据类型相匹配的Java POJO对象。 |
public static final java.lang.String WRAPPER_PROPERTY
public static final java.lang.String DATA_PROPERTY
public static final java.lang.String DATATYPE_PROPERTY
public static final java.lang.String STATE_PROPERTY
public static final java.lang.String ENTITY_ID_PROPERTY
public static final java.lang.String OLD_DATA_PROPERTY
public static org.codehaus.jackson.map.ObjectMapper getObjectMapper()
public static java.lang.String getString(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, java.lang.String defaultValue)
public static java.lang.String getString(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property)
public static boolean getBoolean(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, boolean defaultValue)
public static boolean getBoolean(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property)
public static int getInt(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, int defaultValue)
public static int getInt(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property)
public static long getLong(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, long defaultValue)
public static long getLong(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property)
public static float getFloat(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, float defaultValue)
public static float getFloat(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property)
public static double getDouble(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, double defaultValue)
public static double getDouble(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property)
public static java.util.Date getDate(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, java.util.Date defaultValue)
public static java.util.Date getDate(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property)
public static <T> T get(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, java.lang.Class<T> classType) throws org.codehaus.jackson.JsonParseException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
org.codehaus.jackson.JsonParseException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
public static <T> T get(org.codehaus.jackson.node.ObjectNode objectNode, java.lang.String property, org.codehaus.jackson.type.TypeReference valueTypeRef) throws org.codehaus.jackson.JsonParseException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
org.codehaus.jackson.JsonParseException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
public static DataType getDataType(java.lang.String dataTypeName, JsonConvertContext context) throws java.lang.Exception
java.lang.Exception
public static java.lang.Object toJavaObject(org.codehaus.jackson.JsonNode jsonNode, DataType dataType) throws java.lang.Exception
jsonNode
- 要转换的JSON数据。dataType
- 目标数据类型。java.lang.Exception
public static java.lang.Object toJavaObject(org.codehaus.jackson.JsonNode jsonNode, DataType dataType, boolean proxy) throws java.lang.Exception
json
- 要转换的JSON数据。dataType
- 目标数据类型。targetType
- 目标数据类型。java.lang.Exception
public static java.lang.Object toJavaObject(org.codehaus.jackson.JsonNode jsonNode, DataType dataType, java.lang.Class<?> targetType, boolean proxy, JsonConvertContext context) throws java.lang.Exception
json
- 要转换的JSON数据。dataType
- 目标数据类型。targetType
- 目标数据类型。proxy
- 是否对转换得到的Java POJO对象进行动态代理。context
- 上下文。java.lang.Exception
Copyright © 2001-2011 www.BSTEK.com All Rights Reserved.