Annotation Interface ModelProp
ModelView to automatically generate EpoxyModels from custom
views - https://github.com/airbnb/epoxy/wiki/Generating-Models-from-View-Annotations
This annotation should be used on setter methods within a custom view class. Setters annotated with this will have a corresponding field on the generated model.
Alternatively, if your setter has no side effects, you can use this annotation on a field to have Epoxy set that field directly and avoid the boiler plate of a setter.
For convenience you can use TextProp instead for props representing text.
Similarly you can use CallbackProp for props representing listeners or callbacks.
Alternatively, the options() parameter can be used to configure a prop.
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe name of the constant field that should be used as the default value for this prop.Specify an optional group name.Specify anyModelProp.Optionvalues that should be used when generating the model class.The same asoptions(), but this allows the shortcut of setting an option eg "@ModelProp(DoNotHash)".
-
Element Details
-
options
ModelProp.Option[] optionsSpecify anyModelProp.Optionvalues that should be used when generating the model class.- Default:
- {}
-
value
ModelProp.Option[] valueThe same asoptions(), but this allows the shortcut of setting an option eg "@ModelProp(DoNotHash)".- Default:
- {}
-
defaultValue
String defaultValueThe name of the constant field that should be used as the default value for this prop. The default value will be used if the prop value isn't set on the model.For example, you would define a constant in your view class like
static final int DEFAULT_NUM_LINES = 3, and then set this parameter to "DEFAULT_NUM_LINES" so that the annotation processor knows what constant to reference.The name of the constant must be used instead of referencing the constant directly since objects are not valid annotation parameters.
- Default:
- ""
-
group
String groupSpecify an optional group name. Multiple props with the same group name will only allow one of the props to be set on the view.https://github.com/airbnb/epoxy/wiki/Generating-Models-from-View-Annotations#prop-groups
- Default:
- ""
-