Annotation 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

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Special interface to indicate that the target should be inherited from the annotated annotation.
    static class 
     
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<?>[]
    Provide links for representation classes listed here.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the anchor
    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 resource
    Specifies the media
    Specifies the relationship.
    Specifies the reverse relationship.
    The style of URI to inject
    Specifies the title.
    Specifies the media type.
  • Element Details

    • style

      The style of URI to inject
      Default:
      ABSOLUTE_PATH
    • bindings

      Binding[] bindings
      Specifies the bindings for embedded URI template parameters.
      See Also:
      Default:
      {}
    • 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:
      {}