}
// example: .get()
p("." + restMethod + "();");
// Handle JSONP specific configuration...
JSONP jsonpAnnotation = getAnnotation(method, JSONP.class);
final boolean isJsonp = restMethod.equals(METHOD_JSONP) && jsonpAnnotation!=null;
if( isJsonp ) {
if (returnRequest && !method.getReturnType().getQualifiedSourceName().equals(JsonpRequest.class.getName())) {
getLogger().log(ERROR, "Invalid rest method. JSONP method must have void or JsonpRequest return types: " + method.getReadableDeclaration());
throw new UnableToCompleteException();
}
if( jsonpAnnotation.callbackParam().length() > 0 ) {
p("(("+JSONP_METHOD_CLASS+")__method).callbackParam("+wrap(jsonpAnnotation.callbackParam())+");");
}
if( jsonpAnnotation.failureCallbackParam().length() > 0 ) {
p("(("+JSONP_METHOD_CLASS+")__method).failureCallbackParam("+wrap(jsonpAnnotation.failureCallbackParam())+");");
}
} else {
if (returnRequest && !method.getReturnType().getQualifiedSourceName().equals(Request.class.getName())) {
getLogger().log(ERROR, "Invalid rest method. Non JSONP method must have void or Request return types: " + method.getReadableDeclaration());
throw new UnableToCompleteException();