@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");
}
public abstract String[] value
Copyright © 2015 eXo Platform SAS. All rights reserved.