Annotation Interface Observable


@Inherited @Documented @Target(TYPE) @Retention(RUNTIME) public @interface Observable
Types that are annotated with this annotation are observable.
This means that there are methods that can be called to add and remove listeners.
The annotated type might be associated with an event system.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    @NotNull String[]
    Returns the methods that are used to add remove listeners.
    The methods which are returned by this method must be public and non-static.
    They must have exactly one parameter of the type that is returned by value().
    The methods can include wildcard characters or regular expressions.
    @NotNull Class<?>
    Returns the type of the observer that is used by this observable.
    The type might be used to automatically register and unregister listeners.
    If the type is Object.class, no type is specified.
  • Element Details

    • value

      @NotNull @NotNull Class<?> value
      Returns the type of the observer that is used by this observable.
      The type might be used to automatically register and unregister listeners.
      If the type is Object.class, no type is specified.
      Returns:
      The type of the observer
      Default:
      java.lang.Object.class
    • methods

      @NotNull @NotNull String[] methods
      Returns the methods that are used to add remove listeners.
      The methods which are returned by this method must be public and non-static.
      They must have exactly one parameter of the type that is returned by value().
      The methods can include wildcard characters or regular expressions.
      Returns:
      The methods that are used to add and remove listeners
      Default:
      {}