Annotation Interface Inverse


@Documented @Target(METHOD) public @interface Inverse
The Inverse annotation is used to annotate the reverse direction of the relationship annotated by the Reference annotation. The Inverse annotation MUST be paired with a reference. The method annotated with this annotation must return a class annotated with the ArezComponent annotation or a Collection, a List or a Set where the type parameter refers to a class annotated with the ArezComponent annotation. If the method returns a non-collection type then the type must also be annotated with either Nonnull or Nullable.

The method must also conform to the following constraints:

  • Must not be annotated with any other arez annotation
  • Must have 0 parameters
  • Must return a value.
  • Must be abstract
  • Must not throw exceptions
  • Must be accessible to the class annotated by the ArezComponent annotation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Return the name of the inverse relative to the component.
    Return the name of the reference that the inverse is associated with.
  • Element Details

    • name

      @Nonnull String name
      Return the name of the inverse relative to the component. The value must conform to the requirements of a java identifier. If not specified, the name will be derived by assuming the naming convention "get[Name]" or failing that the name will be the method name.
      Returns:
      the name of the inverse relative to the component.
      Default:
      "<default>"
    • referenceName

      Return the name of the reference that the inverse is associated with. The value must conform to the requirements of a java identifier. If not specified, the name will be derived by assuming that the reference name is the camelCase name of the class on which the Inverse annotation appears unless the Inverse appears on an interface in which case it is the class annotated with ArezComponent.
      Returns:
      the name of the reference relative to the component.
      Default:
      "<default>"