Package arez.annotations
Annotation Interface OnDeactivate
Identifies method that is called when the
ComputableValue
changes to the INACTIVE state from
any other state.
This method can only be associated with a Memoize
annotated method that has 0 parameters.
This limitation is in place to limit implementation complexity and because no use case for this
functionality has been found.
The method must also conform to the following constraints:
- Must not be annotated with any other arez annotation
- Must have 0 parameters
- Must not return a value
- Must not be private
- Must not be static
- Must not be abstract
- Must not throw exceptions
- Must not be for a
Memoize
method that has theMemoize.keepAlive()
parameter set to true - Must be accessible to the class annotated by the
ArezComponent
annotation. -
Should not be public as not expected to be invoked outside the component. A warning will be generated but can
be suppressed by the
SuppressWarnings
orSuppressArezWarnings
annotations with a key "Arez:PublicHookMethod". 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
ArezComponent
annotation as the method is not expected to be invoked outside the component. A warning will be generated but can be suppressed by theSuppressWarnings
orSuppressArezWarnings
annotations with a key "Arez:ProtectedMethod".
-
Optional Element Summary
-
Element Details
-
name
Return the name of the ComputableValue that this method is associated with. This value will be derived if the method name matches the pattern "on[Name]Deactivate", otherwise it must be specified.- Returns:
- the name of the ComputableValue.
- Default:
- "<default>"
-