Value object holding the result of some operation in a generic form which is suitable for outputting as JSON.


Properties

NameReturnsNotes
dataObjectAny JSON friendly object
fieldMessagesList<FieldMessage>List of messages relating to specific fields. The field name must correspond to a POST variable name
htmlContentTypeboolean
jsonContentTypeboolean
messagesList<String>Any messages which are not specific to certain fields
nextHrefStringIf 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
statusbooleanFlag to indicate success or failure of the operation

Methods

SignatureReturnsNotes
dataAttribute(String key, Object value)JsonResultAttempts 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)JsonResultCalls 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)JsonResultSame as addFieldMessage but returns this to allow chaining
message(String message)JsonResultSame as addMessage but returns this to allow chaining
addMessage(String s)voidAdds a mesage to the messags list
addFieldMessage(String field, String message)voidAdds a FieldMessage to the field messages list
writeWithNiceDates(OutputStream out)voidOutputs Date as a long
write(OutputStream out)void
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.