org.fusesource.restygwt.client
Class JsonpMethod

java.lang.Object
  extended by org.fusesource.restygwt.client.Method
      extended by org.fusesource.restygwt.client.JsonpMethod

public class JsonpMethod
extends Method

A specialized method which accesses a resource as a JSONP request.

Author:
Hiram Chirino

Constructor Summary
JsonpMethod(Resource resource)
           
 
Method Summary
 JsonpMethod callbackParam(String callbackParam)
           
 Method expect(int... status)
          sets the expected response status code.
 JsonpMethod failureCallbackParam(String failureCallbackParam)
           
 Request getRequest()
           
 Response getResponse()
           
 Method header(String header, String value)
           
 Method headers(Map<String,String> headers)
           
 Method json(JSONValue data)
           
 Method password(String password)
           
 void send(AsyncCallback<JavaScriptObject> callback)
          helper method to make RestServiceClassCreator easier to maintain
 void send(JsonCallback callback)
           
 void send(RequestCallback callback)
           
 void send(TextCallback callback)
           
 void send(XmlCallback callback)
           
 Method text(String data)
           
 Method timeout(int timeout)
           
 Method user(String user)
           
 Method xml(Document data)
           
 
Methods inherited from class org.fusesource.restygwt.client.Method
addData, defaultAcceptType, defaultContentType, getData, getDispatcher, isExpected, send, setDispatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonpMethod

public JsonpMethod(Resource resource)
Method Detail

callbackParam

public JsonpMethod callbackParam(String callbackParam)

failureCallbackParam

public JsonpMethod failureCallbackParam(String failureCallbackParam)

timeout

public Method timeout(int timeout)
Overrides:
timeout in class Method

send

public void send(JsonCallback callback)
Overrides:
send in class Method

send

public void send(TextCallback callback)
Overrides:
send in class Method

send

public void send(AsyncCallback<JavaScriptObject> callback)
helper method to make RestServiceClassCreator easier to maintain

Parameters:
callback -

send

public void send(RequestCallback callback)
          throws RequestException
Overrides:
send in class Method
Throws:
RequestException

expect

public Method expect(int... status)
Description copied from class: Method
sets the expected response status code. If the response status code does not match any of the values specified then the request is considered to have failed. Defaults to accepting 200,201,204. If set to -1 then any status code is considered a success.

Overrides:
expect in class Method

getRequest

public Request getRequest()
Overrides:
getRequest in class Method

getResponse

public Response getResponse()
Overrides:
getResponse in class Method

header

public Method header(String header,
                     String value)
Overrides:
header in class Method

headers

public Method headers(Map<String,String> headers)
Overrides:
headers in class Method

json

public Method json(JSONValue data)
Overrides:
json in class Method

password

public Method password(String password)
Overrides:
password in class Method

send

public void send(XmlCallback callback)
Overrides:
send in class Method

text

public Method text(String data)
Overrides:
text in class Method

user

public Method user(String user)
Overrides:
user in class Method

xml

public Method xml(Document data)
Overrides:
xml in class Method


Copyright © 2010-2011 FuseSource, Corp.. All Rights Reserved.