|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
CRest
rest-binding annotations to be used to configure user interfaces.
See:
Description
Annotation Types Summary | |
---|---|
ConnectionTimeout | Optional method level annotation, sets the method connection timeout. |
ContextPath | Optional interface level annotation, sets the service context path. |
Destination | Optional method argument level annotation, sets the parameter destination in the request. |
Encoding | Optional interface level annotation, sets the service encoding. |
EndPoint | Mandatory interface level annotation, sets the service end point. |
ErrorHandler | Optional method level annotation, sets the method error handler. |
GlobalInterceptor | Optional interface level annotation, sets the global interface interceptor. |
HttpMethod | Optional method level annotation, sets the method http method. |
Injector | Optional method argument level annotation, sets the injector to use. |
Name | Optional method argument level annotation, sets the parameter name to use in the request. |
Param | Optional method level annotation, sets a method default parameter to add for all requests. |
Params | Optional method level annotation, sets a method default parameter list to add for all requests. |
Path | Optional method level annotation, sets the method path. |
RequestInterceptor | Optional method level annotation, sets the method interceptor. |
ResponseHandler | Optional method level annotation, sets the method response handler. |
RetryHandler | Optional method level annotation, sets the method retry handler. |
Serializer | Optional method argument level annotation, sets the parameter serializer to use. |
SocketTimeout | Optional method level annotation, sets the method socket timeout. |
Contains CRest
rest-binding annotations to be used to configure user interfaces.
An annotated user interface could look like the following:
@EndPoint("http://my-server")
@ContextPath("/rest")
interface FooInterface {
@Path("/model/{0}")
MyModel getModel(long id);
MyModel get();
}
CRest crest = new CRestBuilder().build();
FooInterface fooInstance = crest.build(FooInterface.class);
MyModel m = fooInstance.getModel(5); // a GET request is fired to http://my-server/rest/model/5, response is automatically marshalled and returned as an object.
MyModel m2 = fooInstance.get(); // a GET request is fired to http://my-server/rest, response is automatically marshalled and returned as an object.
For more information on how these values are used, please consult InterfaceConfig
, MethodConfig
, ParamConfig
documentation.
CRest
,
CRestBuilder
,
AnnotationDrivenInterfaceConfigFactory
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |