2021SC@SDUSC
JSONRequest是APIJSON发送请求的方法
model中的JSONRequest继承了APIJSON中的JSONRequest
public class JSONRequest extends apijson.JSONRequest {}
private static final long serialVersionUID = 1L;
public JSONRequest() {
super();
}
/**
* encode = true
* {@link #JSONRequest(String, Object)}
* @param object
*/
public JSONRequest(Object object) {
super(object);
}
/**
* @param name
* @param object
*/
public JSONRequest(String name, Object object) {
super(name, object);
}
super()调用了父类apijson.JSONRequest的JSONRequest()如下
public class JSONRequest extends JSONObject {
private static final long serialVersionUID = 1L;
public JSONRequest() {
super();
}
/**
* @param object must be annotated by {@link MethodAccess}
* @see {@link #JSONRequest(String, Object)}
*/
public JSONRequest(Object object) {
this(null, object);
}
/**
* @param name
* @param object
* @see {@link #puts(String, Object)}
*/
public JSONRequest(String name, Object object) {
this();
puts(name, object);
}
}
这里是三种请求
public JSONRequest()
public JSONRequest(Object object)
public JSONRequest(String name, Object object)
public JSONRequest()直接调用父类方法
public JSONRequest(Object object)
根据内部构造得知,使用时调用了public JSONRe