Package org.glassfish.jersey.linking
Annotation Interface ProvideLink
@Target({METHOD,TYPE})
@Repeatable(ProvideLinks.class)
@Retention(RUNTIME)
@Beta
public @interface ProvideLink
Use this on resource methods to contribute links to a representation.
It is the inverse of
InjectLink
instead of annotating the target you annotate the source of the links.
The added benefit is that since you annotate the method you don't need to specify the path to it.
@ProvideLink(value = Order.class, rel = "self", bindings = @Binding(name = "orderId", value = "${instance.id}")) @ProvideLink(value = PaymentConfirmation.class, rel = "order", bindings = @Binding(name = "orderId", value = "${instance.orderId}")) public Response get(@PathParam("orderId") String orderId) { ...It can also be used as a meta annotation, see the Javadoc of
ProvideLink.InheritFromAnnotation
for details.- Author:
- Leonard Brünings
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Special interface to indicate that the target should be inherited from the annotated annotation.static class
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionSpecifies the anchorBinding[]
Specifies the bindings for embedded URI template parameters.Specifies a boolean EL expression whose value determines whether a Ref is set (true) or not (false).Specifies extension parameters as name-value pairs.Specifies the lang of the referenced resourceSpecifies the mediaSpecifies the relationship.Specifies the reverse relationship.The style of URI to injectSpecifies the title.Specifies the media type.
-
Element Details
-
value
Class<?>[] valueProvide links for representation classes listed here. May useProvideLink.InheritFromAnnotation
for Meta-Annotations
-
-
-
style
InjectLink.Style styleThe style of URI to inject- Default:
- ABSOLUTE_PATH
-
bindings
Binding[] bindingsSpecifies the bindings for embedded URI template parameters.- See Also:
- Default:
- {}
-
condition
String conditionSpecifies a boolean EL expression whose value determines whether a Ref is set (true) or not (false). Omission of a condition will always insert a ref.- Default:
- ""
-
rel
String relSpecifies the relationship.- Default:
- ""
-
rev
String revSpecifies the reverse relationship.- Default:
- ""
-
type
String typeSpecifies the media type.- Default:
- ""
-
title
String titleSpecifies the title.- Default:
- ""
-
anchor
String anchorSpecifies the anchor- Default:
- ""
-
media
String mediaSpecifies the media- Default:
- ""
-
hreflang
String hreflangSpecifies the lang of the referenced resource- Default:
- ""
-
extensions
InjectLink.Extension[] extensionsSpecifies extension parameters as name-value pairs.- Default:
- {}
-