public class JSONResponse extends AbstractPostResponse
JSONResponse
is an AbstractPostResponse
preparing
the response in JSON.Modifier and Type | Class and Description |
---|---|
class |
JSONResponse.JSONResponseException |
Modifier and Type | Field and Description |
---|---|
static String |
RESPONSE_CONTENT_TYPE |
PN_ERROR, PN_IS_CREATED, PN_LOCATION, PN_PARENT_LOCATION, PN_PATH, PN_REFERER, PN_STATUS_CODE, PN_STATUS_MESSAGE, PN_TITLE
Constructor and Description |
---|
JSONResponse() |
Modifier and Type | Method and Description |
---|---|
protected void |
doSend(javax.servlet.http.HttpServletResponse response) |
Throwable |
getError()
Returns any recorded error or
null |
Object |
getProperty(String name)
Returns the generic response property with the given name and type or
null if no such property exists. |
void |
onChange(String type,
String... arguments)
Records a generic change of the given
type with arguments. |
void |
setError(Throwable error)
Sets the recorded error causing the operation to fail.
|
void |
setProperty(String name,
Object value)
Sets a generic response property with the given
|
getLocation, getParentLocation, getPath, getProperty, getReferer, getStatusCode, getStatusMessage, isCreateRequest, isSuccessful, onCopied, onCreated, onDeleted, onModified, onMoved, send, setCreateRequest, setLocation, setParentLocation, setPath, setReferer, setStatus, setTitle
public static final String RESPONSE_CONTENT_TYPE
public JSONResponse() throws JSONResponse.JSONResponseException
public void onChange(String type, String... arguments) throws JSONResponse.JSONResponseException
PostResponse
type
with arguments.type
- The type of the modificationarguments
- The arguments to the modificationsJSONResponse.JSONResponseException
public void setError(Throwable error)
PostResponse
setError
in interface PostResponse
setError
in class AbstractPostResponse
public Throwable getError()
AbstractPostResponse
null
getError
in interface PostResponse
getError
in class AbstractPostResponse
null
public void setProperty(String name, Object value)
AbstractPostResponse
setProperty
in class AbstractPostResponse
name
- name of the propertyvalue
- value of the propertypublic Object getProperty(String name) throws JSONResponse.JSONResponseException
AbstractPostResponse
null
if no such property exists.getProperty
in class AbstractPostResponse
JSONResponse.JSONResponseException
protected void doSend(javax.servlet.http.HttpServletResponse response) throws IOException
doSend
in class AbstractPostResponse
IOException
Copyright © 2014 The Apache Software Foundation. All rights reserved.