Annotation Type HtmlLink


Used in conjunction with the HtmlSerializer class to define hyperlinks.

Can be used in the following locations:

  • Classes.
  • @Rest-annotated classes and @RestOp-annotated methods when an on() value is specified.

Annotation that can be used to specify that a class has a URL associated with it.

When rendered using the HtmlSerializer class, this class will get rendered as a hyperlink like so...

<a href='hrefProperty'>nameProperty</a>

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The bean property whose value becomes the name in the hyperlink.
    Dynamically apply this annotation to the specified classes.
    Class<?>[]
    Dynamically apply this annotation to the specified classes.
    The bean property whose value becomes the url in the hyperlink.
  • Element Details

    • nameProperty

      The bean property whose value becomes the name in the hyperlink.
      Returns:
      The annotation value.
      Default:
      "name"
    • on

      Dynamically apply this annotation to the specified classes.

      Used in conjunction with BeanContext.Builder.applyAnnotations(Class...) to dynamically apply an annotation to an existing class. It is ignored when the annotation is applied directly to classes.

      Valid patterns:
      • Classes:
        • Fully qualified: "com.foo.MyClass"
        • Fully qualified inner class: "com.foo.MyClass$Inner1$Inner2"
        • Simple: "MyClass"
        • Simple inner: "MyClass$Inner1$Inner2" or "Inner1$Inner2" or "Inner2"
      • A comma-delimited list of anything on this list.
      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • onClass

      Dynamically apply this annotation to the specified classes.

      Identical to on() except allows you to specify class objects instead of a strings.

      See Also:
      Returns:
      The annotation value.
      Default:
      {}
    • uriProperty

      The bean property whose value becomes the url in the hyperlink.
      Returns:
      The annotation value.
      Default:
      "uri"