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, isSafeReferer, isSuccessful, onCopied, onCreated, onDeleted, onModified, onMoved, send, setCreateRequest, setLocation, setParentLocation, setPath, setReferer, setStatus, setTitlepublic static final String RESPONSE_CONTENT_TYPE
public void onChange(String type, String... arguments)
PostResponsetype with arguments.type - The type of the modificationarguments - The arguments to the modificationspublic void setError(Throwable error)
PostResponsesetError in interface PostResponsesetError in class AbstractPostResponsepublic Throwable getError()
AbstractPostResponsenullgetError in interface PostResponsegetError in class AbstractPostResponsenullpublic void setProperty(String name, Object value)
AbstractPostResponsesetProperty in class AbstractPostResponsename - name of the propertyvalue - value of the propertypublic Object getProperty(String name)
AbstractPostResponsenull if no such property exists.getProperty in class AbstractPostResponseprotected void doSend(javax.servlet.http.HttpServletResponse response)
throws IOException
doSend in class AbstractPostResponseIOExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.