@Target(value={METHOD,TYPE}) @Repeatable(value=ProvideLinks.class) @Retention(value=RUNTIME) @Beta public @interface ProvideLink
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.Modifier and Type | Required Element and Description |
---|---|
Class<?>[] |
value
Provide links for representation classes listed here.
|
Modifier and Type | Optional Element and Description |
---|---|
String |
anchor
Specifies the anchor
|
Binding[] |
bindings
Specifies the bindings for embedded URI template parameters.
|
String |
condition
Specifies a boolean EL expression whose value determines whether a Ref is
set (true) or not (false).
|
InjectLink.Extension[] |
extensions
Specifies extension parameters as name-value pairs.
|
String |
hreflang
Specifies the lang of the referenced resource
|
String |
media
Specifies the media
|
String |
rel
Specifies the relationship.
|
String |
rev
Specifies the reverse relationship.
|
InjectLink.Style |
style
The style of URI to inject
|
String |
title
Specifies the title.
|
String |
type
Specifies the media type.
|
public abstract Class<?>[] value
ProvideLink.InheritFromAnnotation
for Meta-Annotationspublic abstract InjectLink.Style style
public abstract String condition
public abstract String rel
public abstract String rev
public abstract String type
public abstract String title
public abstract String anchor
public abstract String media
public abstract String hreflang
public abstract InjectLink.Extension[] extensions
Copyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.