Package org.restlet.resource
Annotation Type Status
-
@Documented @Retention(RUNTIME) @Target(TYPE) public @interface Status
Annotation forThrowable
that map to HTTP error statuses. Its semantics is equivalent to an HTTP status line plus a related HTTP entity for errors.
Example:@Get public MyBean represent() throws MyServerError, MyNotFoundError; @Status(500) public class MyServerError implements Throwable{ ... } @Status(404, serialize = false) public class MyNotFoundError extends RuntimeException{ ... } @Status(value = 400) public class MyBadParameterError extends RuntimeException{ public String getParameterName() { ... }; ... }
- Author:
- Jerome Louvel