To get full access to the Kademi Hub existing customers can login here, or new customers can register here.
Value object holding the result of some operation in a generic form which is suitable for outputting as JSON.
Properties
| Name | Returns | Notes |
|---|---|---|
| data | Object | Any JSON friendly object |
| fieldMessages | List<FieldMessage> | List of messages relating to specific fields. The field name must correspond to a POST variable name |
| htmlContentType | boolean | |
| jsonContentType | boolean | |
| messages | List<String> | Any messages which are not specific to certain fields |
| nextHref | String | If an object was created this should be the href of that object. If the operation completed was part of a workflow then this should be the href of the next step in the workflow |
| status | boolean | Flag to indicate success or failure of the operation |
Methods
| Signature | Returns | Notes |
|---|---|---|
dataAttribute(String key, Object value) | JsonResult | Attempts to create a name/value pair in the data object. IF data is null it is created as a HashMap. If its already a Map, the key and value is added If it exists and is not a Map an exception is thrown |
dataAttributes(Map<String,Object> attributes) | JsonResult | Calls dataAttribute for each entry in the provided Map. if the value is serializable it is added as is, otherwise is converted to a string |
fieldMessage(String fieldName, String message) | JsonResult | Same as addFieldMessage but returns this to allow chaining |
message(String message) | JsonResult | Same as addMessage but returns this to allow chaining |
addMessage(String s) | void | Adds a mesage to the messags list |
addFieldMessage(String field, String message) | void | Adds a FieldMessage to the field messages list |
writeWithNiceDates(OutputStream out) | void | Outputs Date as a long |
write(OutputStream out) | void |