Package arez.annotations
Annotation Interface Action
Methods marked with this annotation are invoked in an Arez transaction.
The method that is annotated with this annotation must comply with the additional constraints:
- Must not be annotated with any other arez annotation
- Must not be private
- Must not be static
- Must not be final
- Must not be abstract
- Must be accessible to the class annotated by the
ArezComponent
annotation.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Does the action mutate state or not.Return the name of the Action relative to the component.boolean
Return true if the parameters should be reported to the Arez spy subsystem.boolean
Return true if the return value of the action (if any) should be reported to the Arez spy subsystem.boolean
True if the action should always start a new transaction.boolean
Flag indicating whether the code should verify that at least one read or write occurs within the scope of the action.
-
Element Details
-
name
Return the name of the Action relative to the component. The value must conform to the requirements of a java identifier. The name must also be unique acrossObservable
s,Memoize
s andAction
s within the scope of theArezComponent
annotated element.- Returns:
- the name of the Action relative to the component.
- Default:
- "<default>"
-
mutation
boolean mutationDoes the action mutate state or not.- Returns:
- true if method should be wrapped in READ_WRITE transaction, false if it should it should be wrapped in READ_ONLY transaction.
- Default:
- true
-
reportParameters
boolean reportParametersReturn true if the parameters should be reported to the Arez spy subsystem. It is useful to disable reporting for large, circular or just uninteresting parameters to the spy infrastructure.- Returns:
- true to report the parameters, false otherwise.
- Default:
- true
-
reportResult
boolean reportResultReturn true if the return value of the action (if any) should be reported to the Arez spy subsystem. It is useful to disable reporting for large, circular or just uninteresting parameters to the spy infrastructure.- Returns:
- true to report the return value, false otherwise.
- Default:
- true
-
requireNewTransaction
boolean requireNewTransactionTrue if the action should always start a new transaction. A false value indicates that the action will use the invoking transaction if present, otherwise will create a new transaction to invoke action.- Returns:
- true if the action will create a new transaction, false if it will use the existing transaction if present.
- Default:
- false
-
verifyRequired
boolean verifyRequiredFlag indicating whether the code should verify that at least one read or write occurs within the scope of the action.- Returns:
- true to verify action reads or writes observable data.
- Default:
- true
-