Annotation Type StatusCode
Annotation used to denote an HTTP response status code.
Can be used in the following locations:
- Arguments of server-side
@RestOp -annotated methods. - Methods and return types of server-side and client-side
@Response -annotated interfaces.
Arguments of server-side @RestOp -annotated methods
On server-side REST, this annotation can be applied to method parameters to identify them as an HTTP response value.
Example:
The parameter type must be Value
with a parameterized type of Integer
.
Public methods of @Response -annotated types
On @Response
-annotated classes, this method can be used to denote an HTTP status code on a response.
Example:
The method being annotated must be public and return a numeric value.
See Also:
Methods and return types of server-side and client-side @Response-annotated interfaces
See Also:
See Also:
-
Optional Element Summary
-
Element Details
-
on
Dynamically apply this annotation to the specified classes.See Also:
- Returns:
- The annotation value.
- Default:
- {}
-
onClass
Dynamically apply this annotation to the specified classes.Identical to
on()
except allows you to specify class objects instead of a strings.See Also:
- Returns:
- The annotation value.
- Default:
- {}
-
value
int[] valueThe HTTP response codes. The default value is500 for exceptions and200 for return types.- Returns:
- The annotation value.
- Default:
- {}
-