Spiffy UI Framework

org.spiffyui.client.rest
Interface RESTObjectCallBack<T>

Type Parameters:
T - - The object type for the callback

public interface RESTObjectCallBack<T>

This interface is implemented by request callers to get the bean or Object back from a REST call.

RESTObjectCallBack is an optional interface. You can just implement RESTCallBack. The purpose of the RESTObjectCallBack object is to abstract away the knowledge of JSON, HTTP, or AJAX REST. A class calling the RESTObjectCallBack only has to deal with well formed Java objects in GWT and doesn't need to parse JSON or handle HTTP errors.

See Also:
RESTCallback, RESTility

Method Summary
 void error(RESTException e)
           Called when the REST endpoint return successfully with an error message in the payload.
 void error(java.lang.String message)
           Called when there is an unexpected error.
 void success(T o)
           Called when your REST call succeeds.
 

Method Detail

success

void success(T o)

Called when your REST call succeeds.

Success is defined as a call that contacted the server and the server returned a valid JSON response.

Parameters:
o - The marshalled object from the REST call

error

void error(java.lang.String message)

Called when there is an unexpected error.

These errors are results like network failures and other reasons the server can't be contacted. This method is also called when the server returns a result that isn't valid JSON data.

Parameters:
message - The error message from the server

error

void error(RESTException e)

Called when the REST endpoint return successfully with an error message in the payload.

This method is called when the server returned valid JSON in the format of a Spiffy UI RESTException

Parameters:
e - the RESTException returned from the server
See Also:
RESTException

Spiffy UI Framework