@MountSpec class TestCrasherOnMountSpec { @OnCreateMountContent static LithoView onCreateMountContent(Context c) { return new LithoView(c); } @OnMount static void onMount(ComponentContext c, LithoView lithoView) { throw new RuntimeException("onMount crash"); } @OnUnmount static void onUnmount(ComponentContext c, LithoView mountedView) { mountedView.setComponentTree(null); } }
return new MountSpecModel( element.getQualifiedName().toString(), element.getAnnotation(MountSpec.class).value(), DelegateMethodExtractor.getDelegateMethods( element, TagExtractor.extractTagsFromSpecClass(types, element), JavadocExtractor.getPropJavadocs(elements, element), element.getAnnotation(MountSpec.class).isPublic(), dependencyInjectionHelper, element.getAnnotation(MountSpec.class).isPureRender(), element.getAnnotation(MountSpec.class).hasChildLithoViews(), element.getAnnotation(MountSpec.class).shouldUseDisplayList(), element.getAnnotation(MountSpec.class).poolSize(), element.getAnnotation(MountSpec.class).canPreallocate(), getMountType(elements, element), SpecElementTypeDeterminator.determine(element),
/** * Used in TreePropTest. */ @MountSpec public class TreePropTestMountSpec { @OnPrepare static void onPrepare( ComponentContext c, @TreeProp TreePropNumberType propA, @Prop TreePropTestResult resultPropA) { resultPropA.mProp = propA; } @OnCreateMountContent static Drawable onCreateMountContent(Context c) { return null; } }
@MountSpec(isPureRender = true) class CardShadowSpec {
@MountSpec public static class DupeMountSpec { @OnPrepare static void onPrepare(ComponentContext c, @Prop(optional = true) String prop1) {} @OnMount static void onMount( ComponentContext c, Drawable drawable, @Prop String prop1, @Prop int prop2) {} @OnCreateMountContent static Drawable onCreateMountContent(ComponentContext c) { return null; } }
@MountSpec(isPureRender = true, poolSize = 30) class ImageSpec {
@MountSpec(value = "TestMountComponentName", isPublic = false, isPureRender = true) static class TestMountSpec { @OnCreateInitialState static void createInitialState(@Prop int prop1) {} @OnCreateTreeProp static TestTreeProp onCreateFeedPrefetcherProp(@Prop long prop2) { return new TestTreeProp(prop2); } @OnBoundsDefined static void onBoundsDefined( @Prop Object prop3, @Prop char[] prop4, @FromMeasure Long measureOutput) {} @OnMount static <S extends Object> void onMount( @Prop(optional = true) boolean prop5, @State(canUpdateLazily = true) long state1, @State S state2, @TreeProp TestTreeProp treeProp) {} @OnUnmount static void onUnmount() {} @OnTrigger(TestTriggerEvent.class) static String testTrigger(@FromTrigger int integer, @Prop Object prop3) { return ""; } @ShouldAlwaysRemeasure static boolean shouldAlwaysRemeasure(@Prop boolean prop4) { return prop4; } }
@MountSpec(isPureRender = true) class TransparencyEnabledCardClipSpec {
@MountSpec(isPureRender = true) class CardClipSpec {
@MountSpec(isPureRender = true) class ProgressSpec {
@MountSpec class HorizontalScrollSpec {
@MountSpec static class MountTestSpec { @PropDefault protected static boolean arg0 = true; @OnBind public void testDelegateMethod( @Prop boolean arg0, @Prop @Nullable Component arg4, @Prop List<Component> arg5, @Prop List<String> arg6, @State int arg1, @Param Object arg2, @TreeProp long arg3, @TreeProp Set<List<Row>> arg7, @TreeProp Set<Integer> arg8) {} @OnEvent(Object.class) public void testEventMethod( @Prop boolean arg0, @Prop @Nullable Component arg4, @State int arg1, @Param Object arg2, @TreeProp long arg3) {} @OnUpdateState public void testUpdateStateMethod() {} }
@MountSpec(hasChildLithoViews = true, isPureRender = true) public class VerticalScrollSpec {
@MountSpec public class FrescoImageSpec {
@MountSpec( hasChildLithoViews = true, isPureRender = true,
@MountSpec( isPureRender = true, events = {
@MountSpec( isPureRender = true, events = {
@MountSpec( isPureRender = true, shouldUseDisplayList = true,