Annotation Type LinkResource
-
@Target(METHOD) @Retention(RUNTIME) @Documented public @interface LinkResource
Use this to mark JAX-RS methods that should be included in the REST service discovery. All parameters are optional and may be guessed from the method, whenever possible.- Author:
- Stéphane Épardaud
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringconstraintEL expression that should return a boolean indicating whether or not this service link should be used.StringentityClassNameParamBinding[]matrixParametersList of matrix parameters which should be attached to the link.String[]pathParametersList of path parameter EL from the leftmost URI path parameter to the rightmost.ParamBinding[]queryParametersList of query parameters which should be attached to the link.StringrelThe link relation.Class<?>valueThe type of entity that should receive links for this service.
-
-
-
Element Detail
-
value
Class<?> value
The type of entity that should receive links for this service. Defaults to the request's body entity type, or the response entity type if they are not aCollectionor aResponse.- Default:
- java.lang.Void.class
-
-
-
entityClassName
String entityClassName
- Default:
- ""
-
-
-
rel
String rel
The link relation. This defaults as follows:- list
GETforResourceFacadeentities or methods that return aCollection
- self
GETfor non-ResourceFacadeand non-Collectionentities
- remove
DELETE
- add
POST
- update
PUT
- Default:
- ""
-
-
-
pathParameters
String[] pathParameters
List of path parameter EL from the leftmost URI path parameter to the rightmost. These can be normal constant string values or EL expressions (${foo.bar}) that will resolve using either the default EL context, or the context specified by a
@LinkELProviderannotation. The default context resolves any non-qualified variable to properties of the response entity for whom we're discovering links, and has an extra binding for the "this" variable which is the response entity as well.If there are too many parameters for the current path, only the leftmost useful ones will be used.
Defaults to using discovery of values from the entity itself with
@ResourceID,@ResourceIDs, JAXB's @XmlID or JPA's @Id and@ParentResource.This is not used for
ResourceFacadeentities, which provide their own list of path parameters.- Default:
- {}
-
-
-
queryParameters
ParamBinding[] queryParameters
List of query parameters which should be attached to the link.
- Default:
- {}
-
-
-
matrixParameters
ParamBinding[] matrixParameters
List of matrix parameters which should be attached to the link.
- Default:
- {}
-
-
-
constraint
String constraint
EL expression that should return a boolean indicating whether or not this service link should be used. This is useful for security constraints limiting access to resources. Defaults to using the
@RolesAllowedannotation using the currentSecurityContextto check the current user's permissions.This can be a normal constant boolean value ("true" or "false") or an EL expression (${foo.bar}) that will resolve using either the default EL context, or the context specified by a
@LinkELProviderannotation.For entities that are not
ResourceFacade, the default context resolves any non-qualified variable to properties of the response entity for whom we're discovering links, and has an extra binding for the "this" variable which is the response entity as well.For entities that are a
ResourceFacade, the default context has single binding for the "this" variable which is theResourceFacade's entity type (Classinstance).- Default:
- ""
-
-