|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME)
@Target(value={METHOD,ANNOTATION_TYPE})
public @interface MimeType
Associate a program element with a mime type.
Java controller methods can be annotated with this annotation to associate the controller response with a mime type automatically:
@MimeType("text/html")
public Response index() {
return Response.ok("Hello world");
}
t can also transform an existing annotation into a specialized mime type:
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
@MimeType("text/html")
public @interface HTML {
}
Such mime type can then be used to annotate controller methods:
@HTML()
public Response index() {
return Response.ok("Hello world");
}
| Required Element Summary | |
|---|---|
String[] |
value
|
| Element Detail |
|---|
public abstract String[] value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||