@Documented
@Target(value=METHOD)
public @interface Prop
The method that is annotated with this annotation must also comply with the following constraints:
ReactComponent
Modifier and Type | Optional Element and Description |
---|---|
Feature |
disposable
Return an enum indicating whether the component should check whether the value of the prop is disposed
prior to rendering.
|
boolean |
immutable
True if the prop is not expected to change after initial value is set.
|
java.lang.String |
name
Return the name of the prop.
|
Feature |
observable
Indicate whether the prop should be annotated by
Observable . |
Feature |
require
Return enum indicating whether prop should be when component is constructed.
|
Feature |
shouldUpdateOnChange
Indicate whether changing the value of the prop should schedule a re-render.
|
@Nonnull public abstract java.lang.String name
public abstract Feature require
Feature.ENABLE
then the user MUST supply the prop and the builder will require the user
to specify the value. If set to Feature.DISABLE
then the user can optionally supply the prop.
If set to Feature.AUTODETECT
then the annotation processor will treat it as Feature.DISABLE
if there is a corresponding PropDefault
for the prop, otherwise it will be treated as
Feature.ENABLE
.public abstract Feature shouldUpdateOnChange
Feature.AUTODETECT
then the annotation processor will treat it as
Feature.ENABLE
unless immutable()
is set to true
.public abstract Feature observable
Observable
.
If set to Feature.AUTODETECT
then the prop will be observable if and only if:
shouldUpdateOnChange()
is not set to Feature.DISABLE
.Memoize
or Observe
.public abstract Feature disposable
Feature.AUTODETECT
then the annotation processor will inspect the
type of the prop and treat it as Feature.ENABLE
if the type is annotated with the ArezComponent
annotation.public abstract boolean immutable
Boolean
, Short
etc).String
typeArezComponent
where the ArezComponent.requireId()
parameter does not resolve to Feature.DISABLE
Keyed
In the future, the annotation processor may include additional allowable types such as those that implement
Identifiable
directly or other primitive types within the runtime library. These other
types will be added if demand is established, othewise an additional hook will be added to allow users to
customize key generation using a static method on the component.