Package arez.annotations
Annotation Interface ObservableValueRef
Marks a template method that returns the
ObservableValue instance for
the Observable annotated property. Each property marked with the Observable annotation is backed
by an ObservableValue instance and some frameworks make use of this value to implement
advanced functionality.
The method that is annotated with this annotation must also comply with the following constraints:
- Must not be annotated with any other arez annotation
- Must be abstract
- Must not throw any exceptions
- Must be accessible to the class annotated by the
ArezComponentannotation. -
Must return an instance of
ObservableValueand the type parameter must be the wildcard?or the type of the correspondingObservablemethod. The value may also be "raw" (i.e. without a type parameter). -
Should not be public as not expected to be invoked outside the component. A warning will be generated but can
be suppressed by the
SuppressWarningsorSuppressArezWarningsannotations with a key "Arez:PublicRefMethod". This warning is also suppressed by the annotation processor if it is implementing an interface method. -
Should not be protected if in the class annotated with the
ArezComponentannotation as the method is not expected to be invoked outside the component. A warning will be generated but can be suppressed by theSuppressWarningsorSuppressArezWarningsannotations with a key "Arez:ProtectedMethod".
-
Optional Element Summary
Optional Elements
-
Element Details
-
name
Return the name of the associated ObservableValue property that this ref relates to. This value will be derived if the method name matches the pattern "get[Name]ObservableValue", otherwise it must be specified.- Returns:
- the name of the associated ObservableValue.
- Default:
- "<default>"
-