Package jfun.yan.etc

Examples of jfun.yan.etc.InjectorHelper


        }
      };
     
     
      yan.registerComponent("target",
          new InjectorHelper()
          .getInjectorComponent(Injector.class, injection)
      );
      yan.registerValue("apple");
      MyBean mbean = new MyBean();
      Injector inj = (Injector)yan.getInstance("target");
View Full Code Here


        public Creator bind(Object obj)
        throws IntrospectionException{
          return getBeanInjector(obj);
        }
      };
      Component injector = new InjectorHelper()
      .getInjectorComponent(Injector.class, injection);
      Component dumb_dao = Components.ctor(DumbMyBeanDao.class);
      Component dao = Components.static_method(InjectingDecorator.class,
          "getInjectingDecorator", new Class[]{Object.class, Class.class, Injector.class})
          .withArguments(new Component[]{dumb_dao, Components.value(MyBean.class), injector});
View Full Code Here

        throws IntrospectionException{
          return getBeanInjector(obj);
        }
      };
      Component dumb_dao = Components.ctor(DumbMyBeanDao.class);
      final Component dao = new InjectorHelper().getProxyComponentReturningInjected(MyBeanDao.class,
          dumb_dao, MyBean.class, injection);
      yan.registerComponent("dao", dao);
      MyBeanDao mdao = (MyBeanDao)yan.getInstance("dao");
      assertEquals(mdao, mdao);
      Named mbean = mdao.getBeanById(1);
View Full Code Here

          //.optionalProperties()
          ;
        }
      };
      Component dumb_dao = Components.ctor(DumbBankAccountDao.class);
      InjectorHelper helper = new InjectorHelper();
      Component dao = helper.getProxyComponentReturningInjected(BankAccountDao.class,
          dumb_dao, MyBean.class, bean_injection);
      dao = helper.getProxyComponentReturningInjected(BankAccountDao.class, dao,
          BankAccount.class, account_injection);
      yan.registerComponent("dao", dao);
      yan.registerValue(new Integer(10));
      yan.registerValue(new char[]{'a','b'});
      BankAccountDao mdao = (BankAccountDao)yan.getInstance("dao");
View Full Code Here

TOP

Related Classes of jfun.yan.etc.InjectorHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.