@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Status
Throwable
that map to HTTP error statuses. Its
semantics is equivalent to an HTTP status line plus a related HTTP entity for
errors.@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() { ... }; ... }
Copyright © 2005-2024 Restlet.