|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.adaptc.mws.plugins.MoabRestResponse
public class MoabRestResponse extends Object
This class is used in the IMoabRestService to represent a response from MWS. It contains fields for the response, data, and metadata methods about the response.
Field Summary | |
---|---|
private net.sf.json.JSON |
data
|
private org.springframework.mock.web.MockHttpServletResponse |
response
|
private boolean |
success
|
Constructor Summary | |
MoabRestResponse(org.springframework.mock.web.MockHttpServletResponse response, Object data, boolean success)
Constructs a new response from MWS. |
Method Summary | |
---|---|
private Object
|
convert(net.sf.json.JSON json)
Utility method for converting data from a net.sf.json.JSON instance. |
private Map
|
convert(net.sf.json.JSONObject jsonObject)
Recursive utility method for converting data from a net.sf.json.JSON instance. |
private List
|
convert(net.sf.json.JSONArray jsonArray)
Recursive utility method for converting data from a net.sf.json.JSON instance. |
private Object
|
convert(net.sf.json.JSONNull jsonNull)
Recursive utility method for converting data from a net.sf.json.JSON instance. |
Object
|
getConvertedData()
Returns data converted to an actual Map or List (or null) instead of a net.sf.json.JSON instance. |
net.sf.json.JSON
|
getData()
The parsed JSON body data from the response. |
org.springframework.mock.web.MockHttpServletResponse
|
getResponse()
The actual HTTP response object. |
int
|
getStatus()
The status code of the HTTP response (i.e. 200, 404, 400) in a convenience method. |
boolean
|
hasError()
Returns true if an error was encountered during the request. |
boolean
|
isSuccess()
Returns if the request was successful or not. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
private final net.sf.json.JSON data
private final org.springframework.mock.web.MockHttpServletResponse response
private final boolean success
Constructor Detail |
---|
public MoabRestResponse(org.springframework.mock.web.MockHttpServletResponse response, Object data, boolean success)
response
- The HTTP servlet responsedata
- The data as a Map or JSON, will be converted correctly in either casesuccess
- Whether or not the response is a success
Method Detail |
---|
private Object convert(net.sf.json.JSON json)
private Map convert(net.sf.json.JSONObject jsonObject)
private List convert(net.sf.json.JSONArray jsonArray)
private Object convert(net.sf.json.JSONNull jsonNull)
public Object getConvertedData()
public net.sf.json.JSON getData()
public org.springframework.mock.web.MockHttpServletResponse getResponse()
public int getStatus()
public boolean hasError()
public boolean isSuccess()
Groovy Documentation