|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=CLASS) @Target(value=METHOD) public @interface Get
Use on methods in Rest
annotated class to add a new rest service of
type GET.
value()
is mandatory and define the URI or the full
URL of the web service. It MAY contain placeholders defined as follow :
{name}
The annotated method MAY have parameters as soon as each parameter names are
present as placeholders in the URI.
The annotated method CAN return void
,
ResponseEntity
or any concrete java classes.
Interfaces CAN'T be used as return type because converters have to know which
object to instantiate while returning result.
Note: Generics classes are also supported both for return type and
parameters.
Example :@Rest(rootUrl = "http://myserver", converters = MappingJacksonHttpMessageConverter.class) public interface MyRestClient { @Get("/events") EventList getEvents(); @Get("/events/{max}") ResponseEntity<EventList> getEvents(int max); @Get("/events/{max}/{filter}") ArrayList<Event> getEvents(int max, String filter); }
Rest
,
Post
,
Put
,
Delete
,
Head
,
Options
Required Element Summary | |
---|---|
String |
value
|
Element Detail |
---|
public abstract String value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |