@Retention(value=RUNTIME)
@Documented
public @interface MountSpec
A class that is annotated with MountSpec must implement a method with the OnCreateMountContent annotation. It may also implement methods with the following annotations:
OnLoadStyle
OnEvent
OnPrepare
OnMeasure
OnBoundsDefined
OnMount
OnBind
OnUnbind
OnUnmount
ShouldUpdate
If you wish to create a component that is a composition of other components, then use LayoutSpec instead.
For example:
@MountSpec
public class MyComponentSpec {
@OnCreateMountContent
MyDrawable onCreateMountContent(Context context) {
return new MyDrawable(context);
}
@OnMount
void onMount(
ComponentContext c,
MyDrawable myDrawable,
@Prop MyProp prop) {
myDrawable.setMyProp(prop);
}
}| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
canPreallocate |
java.lang.Class<?>[] |
events |
boolean |
hasChildLithoViews |
boolean |
isPublic |
boolean |
isPureRender |
int |
poolSize |
java.lang.Class<?>[] |
triggers |
java.lang.String |
value
Class name of the generated component.
|
public abstract java.lang.String value
In order to avoid confusion, this should only be used if you have a very good reason for it. For instance to avoid naming collisions.
public abstract boolean isPublic
public abstract boolean isPureRender
public abstract boolean hasChildLithoViews
public abstract java.lang.Class<?>[] events
public abstract int poolSize