org.test4j.json
类 JSON

java.lang.Object
  继承者 org.test4j.json.JSON

public final class JSON
extends Object

json解码,编码工具类

作者:
darui.wudr

构造方法摘要
JSON()
           
 
方法摘要
static String toJSON(Object object, int features)
          将对象编码为json串
static String toJSON(Object object, JSONFeature... features)
          将对象编码为json串
static
<T> T
toObject(JSONObject json, Map<String,Object> references)
          将json字符串反序列为对象
static
<T> T
toObject(JSONObject json, Type type, Map<String,Object> references)
           
static
<T> T
toObject(String json)
          将json字符串反序列为对象
static
<T> T
toObject(String json, Type clazz)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JSON

public JSON()
方法详细信息

toObject

public static final <T> T toObject(String json)
将json字符串反序列为对象

参数:
json -
返回:

toObject

public static final <T> T toObject(String json,
                                   Type clazz)

toObject

public static final <T> T toObject(JSONObject json,
                                   Map<String,Object> references)
将json字符串反序列为对象

类型参数:
T -
参数:
json -
clazz -
decodingFeatures -
返回:

toObject

public static final <T> T toObject(JSONObject json,
                                   Type type,
                                   Map<String,Object> references)

toJSON

public static final String toJSON(Object object,
                                  JSONFeature... features)
将对象编码为json串

参数:
object -
返回:

toJSON

public static final String toJSON(Object object,
                                  int features)
将对象编码为json串

参数:
object -
features -
返回:


Copyright © 2013. All rights reserved.