Package com.airbnb.epoxy
Annotation Interface PackageModelViewConfig
Settings that apply to all views annotated with
ModelView in this
package. Also applies to subpackages, unless other package config values are set in those sub
packages.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnable or Disable an option, or inherit the default. -
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>An optional EpoxyModel subclass that generated models should extend.A default layout pattern to be used for specifying layouts for generated models.Controls whether "builder" setter functions that returns the model type will be duplicated from super model classes with the function return type updated to use the generated model name.Controls whether getter functions (that return the value of each attribute) are generated on models.Controls whether the "reset" function (that clears all attribute values) are generated on models.Suffix, which will be appended to generated model's names.booleanIf true, any layout file name that has a view's default layout as a prefix will be included as a method on the generated model for that view.
-
Element Details
-
rClass
Class<?> rClassThe R class used in this module (eg "com.example.app.R.class"). This is needed so Epoxy can look up layout files.
-
-
-
defaultLayoutPattern
String defaultLayoutPatternA default layout pattern to be used for specifying layouts for generated models. If this is set then a layout can be omitted from a view'sModelViewannotation.The "%s" placeholder represents the view's name in snack case. For example, the default value will use a layout resource of "R.layout.my_view" for the MyView class. If the layout name is changed to "view_holder_%s" then the layout used would be "R.layout.view_holder_my_view".
- Default:
- "%s"
-
defaultBaseModelClass
Class<?> defaultBaseModelClassAn optional EpoxyModel subclass that generated models should extend.- Default:
- java.lang.Void.class
-
useLayoutOverloads
boolean useLayoutOverloadsIf true, any layout file name that has a view's default layout as a prefix will be included as a method on the generated model for that view.For example, if the layout is "R.layout.my_view" then any layouts in the form of "R.layout.my_view_*" will result in a generated method like "with*Layout" that will apply that other layout instead of the default.
- Default:
- false
-
generatedModelSuffix
String generatedModelSuffixSuffix, which will be appended to generated model's names. "Model_" is a default value.- Default:
- "Model_"
-
disableGenerateBuilderOverloads
PackageModelViewConfig.Option disableGenerateBuilderOverloadsControls whether "builder" setter functions that returns the model type will be duplicated from super model classes with the function return type updated to use the generated model name. This helps make all setters (such as id(...) ) return the same generated model so they can be chained in a builder pattern. This is mainly intended for Java usage and is generally unnecessary when using models in kotlin, especially if the generated kotlin model build extension functions are used. Disabling this can greatly reduce the number of methods generated on models. Default is false. This may also be set project wide with an annotation processor option.- Default:
- Default
-
disableGenerateGetters
PackageModelViewConfig.Option disableGenerateGettersControls whether getter functions (that return the value of each attribute) are generated on models. Disabling this can greatly reduce the number of methods generated on models. Default is false. This may also be set project wide with an annotation processor option.- Default:
- Default
-
disableGenerateReset
PackageModelViewConfig.Option disableGenerateResetControls whether the "reset" function (that clears all attribute values) are generated on models. This function is generally legacy and is not recommended to be used with the modern immutable model approach of EpoxyControllers. Disabling this reduces the amount of generated code. Default is false. This may also be set project wide with an annotation processor option.- Default:
- Default
-