@EBean public class SubtypedGenericBean<S extends List<T>, T extends Number> { @Background void backgroundMethod(T param, S param2) { } public T genericMethod() { return null; } @UiThread <S extends List<T>> void uiMethod(S method) { } }
@EBean public class EBeanInterceptor implements ClientHttpRequestInterceptor { @Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { return execution.execute(request, body); } }
@EBean(scope = EBean.Scope.Singleton) public class MyResponseErrorHandlerBean implements ResponseErrorHandler { @Override public boolean hasError(ClientHttpResponse clientHttpResponse) throws IOException { return false; } @Override public void handleError(ClientHttpResponse clientHttpResponse) throws IOException { } }
@EBean public class MyRequestFactory extends HttpComponentsClientHttpRequestFactory { private static final int TIME_OUT = 30 * 1000; public MyRequestFactory() { setConnectTimeout(TIME_OUT); setReadTimeout(TIME_OUT); } }
@EBean public class InnerPrefs { @SharedPref public interface InnerSharedPrefs { } }
@EBean public class SomeArrayAdapter extends ArrayAdapter<String> { public SomeArrayAdapter(Context context) { super(context, android.R.layout.simple_list_item_1); } }
@EBean public class AfterViewBean { public boolean afterViewsCalled = false; @AfterViews public void afterViews() { afterViewsCalled = true; } }
@EBean public class ChildBean1 extends AbstractBean { public ChildBean1() { super("MyBeanConstructorParam"); } }
@EBean public class ChildBean2 extends AbstractBean { public ChildBean2(Context context) { super("MyBeanConstructorParam"); } }
@EBean public abstract class Mother { protected boolean motherInitCalled = false; protected boolean motherInitViewsCalled = false; @AfterInject void initMother() { motherInitCalled = true; } @AfterViews void initViewsMother() { motherInitViewsCalled = true; } }
@EBean public class EnhancedClass { @App SampleRoboApplication customApplication; }
@EBean public static class InnerEnhancedBean { @StringRes(R.string.hello) String hello; }
@EBean public class BeanWithView { @ViewById public View myTextView; }
@EBean public class AfterInjectBean { public boolean afterInjectCalled = false; public boolean notificationManagerNullAfterInject = true; @SystemService NotificationManager notificationManager; @AfterInject void afterInject() { afterInjectCalled = true; notificationManagerNullAfterInject = notificationManager == null; } }
@EBean public abstract class AbstractBean { @RootContext Context context; public AbstractBean(String param) { } @Background void backgroundMethod() { } }
@EBean(scope = EBean.Scope.Singleton) public class SomeCyclicSingletonA { @Bean SomeCyclicSingletonB singletonB; }
@EBean(scope = EBean.Scope.Singleton) public class SomeCyclicSingletonB { @Bean SomeCyclicSingletonA singletonA; }
@EBean(scope = Scope.Singleton) public class SomeSingleton { @RootContext public Context context; /* * Should not be injected (singleton) */ @ViewById public View myTextView; @Bean public BeanWithView beanWithView; }
@EBean public class BeanWithSupportFragments { @FragmentById public MySupportFragment mySupportFragment; @FragmentById(R.id.mySupportFragment) public MySupportFragment mySupportFragment2; @FragmentByTag public MySupportFragment mySupportFragmentTag; @FragmentByTag("mySupportFragmentTag") public MySupportFragment mySupportFragmentTag2; }
@EBean public class BeanWithFragments { @FragmentById public MyFragment myFragment; @FragmentById(R.id.myFragment) public MyFragment myFragment2; @FragmentByTag public MyFragment myFragmentTag; @FragmentByTag("myFragmentTag") public MyFragment myFragmentTag2; }