Package org.glassfish.jersey.linking
Annotation Type 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 ofInjectLinkinstead 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 ofProvideLink.InheritFromAnnotationfor details.- Author:
- Leonard Brünings
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringanchorSpecifies the anchorBinding[]bindingsSpecifies the bindings for embedded URI template parameters.StringconditionSpecifies a boolean EL expression whose value determines whether a Ref is set (true) or not (false).InjectLink.Extension[]extensionsSpecifies extension parameters as name-value pairs.StringhreflangSpecifies the lang of the referenced resourceStringmediaSpecifies the mediaStringrelSpecifies the relationship.StringrevSpecifies the reverse relationship.InjectLink.StylestyleThe style of URI to injectStringtitleSpecifies the title.StringtypeSpecifies the media type.
-
-
-
Element Detail
-
value
Class<?>[] value
Provide links for representation classes listed here. May useProvideLink.InheritFromAnnotationfor Meta-Annotations
-
-
-
style
InjectLink.Style style
The style of URI to inject- Default:
- org.glassfish.jersey.linking.InjectLink.Style.ABSOLUTE_PATH
-
-
-
condition
String condition
Specifies 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 rel
Specifies the relationship.- Default:
- ""
-
-
-
rev
String rev
Specifies the reverse relationship.- Default:
- ""
-
-
-
type
String type
Specifies the media type.- Default:
- ""
-
-
-
title
String title
Specifies the title.- Default:
- ""
-
-
-
anchor
String anchor
Specifies the anchor- Default:
- ""
-
-
-
media
String media
Specifies the media- Default:
- ""
-
-
-
hreflang
String hreflang
Specifies the lang of the referenced resource- Default:
- ""
-
-
-
extensions
InjectLink.Extension[] extensions
Specifies extension parameters as name-value pairs.- Default:
- {}
-
-