org.androidannotations.annotations.Bean.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.androidannotations.annotations.Bean.<init>()方法的一些代码示例,展示了Bean.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bean.<init>()方法的具体详情如下:
包路径:org.androidannotations.annotations.Bean
类名称:Bean
方法名:<init>

Bean.<init>介绍

暂无

代码示例

代码示例来源:origin: androidannotations/androidannotations

  1. protected void injectMultipleDependencies(@Bean EmptyDependency multiDependency, @Bean(SomeImplementation.class) SomeInterface multiDependencyInterface,
  2. @Bean SomeSingleton multiDependencySingleton) {
  3. this.multiDependency = multiDependency;
  4. this.multiDependencyInterface = multiDependencyInterface;
  5. this.multiDependencySingleton = multiDependencySingleton;
  6. }
  7. }

代码示例来源:origin: androidannotations/androidannotations

  1. @Bean
  2. protected void injectDependency(EmptyDependency methodInjectedDependency) {
  3. this.methodInjectedDependency = methodInjectedDependency;
  4. }

代码示例来源:origin: androidannotations/androidannotations

  1. protected void injectDependencyAnnotatedParam(@Bean EmptyDependency annotatedParamDependency) {
  2. this.annotatedParamDependency = annotatedParamDependency;
  3. }

代码示例来源:origin: androidannotations/androidannotations

  1. @Bean(SomeImplementation.class)
  2. protected void injectInterface(SomeInterface methodInjectedInterface) {
  3. this.methodInjectedInterface = methodInjectedInterface;
  4. }

代码示例来源:origin: androidannotations/androidannotations

  1. @Bean
  2. protected void injectSingleton(SomeSingleton methodInjectedSingleton) {
  3. this.methodInjectedSingleton = methodInjectedSingleton;
  4. }

代码示例来源:origin: androidannotations/androidannotations

  1. protected void injectSingletonAnnotatedParam(@Bean SomeSingleton annotatedParamSingleton) {
  2. this.annotatedParamSingleton = annotatedParamSingleton;
  3. }

代码示例来源:origin: androidannotations/androidannotations

  1. protected void injectInterfaceAnnotatedParam(@Bean(SomeImplementation.class) SomeInterface annotatedParamInterface) {
  2. this.annotatedParamInterface = annotatedParamInterface;
  3. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EActivity(R.layout.main)
  2. public class AfterViewsActivity extends Activity {
  3. @Bean
  4. AfterViewBean afterViewBean;
  5. public boolean afterViewBeanCalledBefore = false;
  6. @AfterViews
  7. void afterViews() {
  8. afterViewBeanCalledBefore = afterViewBean.afterViewsCalled;
  9. }
  10. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EApplication
  2. public class SampleRoboApplication extends Application {
  3. @Bean
  4. public EmptyDependency someDependency;
  5. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EFragment
  2. public abstract class AbstractFragment extends Fragment {
  3. @Bean
  4. SomeBean someBean;
  5. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EBean(scope = EBean.Scope.Singleton)
  2. public class SomeCyclicSingletonA {
  3. @Bean
  4. SomeCyclicSingletonB singletonB;
  5. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EBean(scope = EBean.Scope.Singleton)
  2. public class SomeCyclicSingletonB {
  3. @Bean
  4. SomeCyclicSingletonA singletonA;
  5. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EIntentService
  2. public class MyIntentService extends AbstractIntentService {
  3. @Bean
  4. EnhancedClass dependency;
  5. public MyIntentService() {
  6. super(MyIntentService.class.getSimpleName());
  7. }
  8. @ServiceAction
  9. void myAction() {
  10. }
  11. @ServiceAction
  12. void actionOne(String valueString) {
  13. }
  14. @ServiceAction("myAction")
  15. void actionThree(String valueString, long valueLong) {
  16. }
  17. }

代码示例来源:origin: androidannotations/androidannotations

  1. BeanWithInnerEnhancedClasses_.InnerPrefs_ innerPrefs;
  2. @Bean
  3. InnerEnhancedBean innerEnhancedBean;
  4. @Bean
  5. SomeImplementation someImplementation;

代码示例来源:origin: androidannotations/androidannotations

  1. @Bean
  2. EnhancedClass dependency;

代码示例来源:origin: androidannotations/androidannotations

  1. @Bean
  2. @NonConfigurationInstance
  3. EmptyDependency maintainedDependency;
  4. @Bean
  5. EmptyDependency recreatedDependency;
  6. @Bean(SomeImplementation.class)
  7. @NonConfigurationInstance
  8. SomeInterface maintainedAbstracted;

代码示例来源:origin: androidannotations/androidannotations

  1. @EReceiver
  2. public class MyReceiver extends BroadcastReceiver {
  3. @SystemService
  4. NotificationManager notificationManager;
  5. @Bean
  6. EnhancedClass dependency;
  7. @Override
  8. public void onReceive(Context context, Intent intent) {
  9. showToast(context);
  10. workInBackground();
  11. }
  12. @Trace
  13. @UiThread
  14. void showToast(Context context) {
  15. Toast.makeText(context, "Hello World!", Toast.LENGTH_LONG).show();
  16. }
  17. @Trace
  18. @Background
  19. void workInBackground() {
  20. Log.d(MyService.class.getSimpleName(), "Doing some background work.");
  21. }
  22. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EBean(scope = Scope.Singleton)
  2. public class SomeSingleton {
  3. @RootContext
  4. public Context context;
  5. /*
  6. * Should not be injected (singleton)
  7. */
  8. @ViewById
  9. public View myTextView;
  10. @Bean
  11. public BeanWithView beanWithView;
  12. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EActivity
  2. public class MyActivity extends Activity {
  3. @OrmLiteDao(helper = DatabaseHelper.class)
  4. UserDao userDao;
  5. @OrmLiteDao(helper = DatabaseHelper.class)
  6. Dao<Car, Long> carDao;
  7. @OrmLiteDao(helper = DatabaseHelper.class)
  8. UserRuntimeExceptionDao userRuntimeExceptionDao;
  9. @OrmLiteDao(helper = DatabaseHelper.class)
  10. RuntimeExceptionDao<Car, Long> runtimeExceptionDao;
  11. @Bean
  12. MyBean ormLiteBean;
  13. }

代码示例来源:origin: androidannotations/androidannotations

  1. @EActivity(R.layout.support_fragments)
  2. public class MySupportFragmentActivity extends FragmentActivity {
  3. @FragmentById
  4. public MySupportFragment mySupportFragment;
  5. @FragmentById(R.id.mySupportFragment)
  6. public MySupportFragment mySupportFragment2;
  7. @FragmentByTag
  8. public MySupportFragment mySupportFragmentTag;
  9. @FragmentByTag("mySupportFragmentTag")
  10. public MySupportFragment mySupportFragmentTag2;
  11. @Bean
  12. public BeanWithSupportFragments beanWithSupportFragments;
  13. }

相关文章