/** * Build the {@link BeanWiringInfo} for the given {@link Configurable} annotation. * @param beanInstance the bean instance * @param annotation the Configurable annotation found on the bean class * @return the resolved BeanWiringInfo */ protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) { if (!Autowire.NO.equals(annotation.autowire())) { // Autowiring by name or by type return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck()); } else if (!"".equals(annotation.value())) { // Explicitly specified bean name for bean definition to take property values from return new BeanWiringInfo(annotation.value(), false); } else { // Default bean name for bean definition to take property values from return new BeanWiringInfo(getDefaultBeanName(beanInstance), true); } }
if (autowire.isAutowire()) { beanDef.setAutowireMode(autowire.value());
/** * Created a bean definition for a class. * Optionally configure all bean properties, like scope, prototype/singleton, etc using: * <p/> * <pre> * BeanDefinition definition = super.createBeanDefinition(beanClass); * definition.setScope(BeanDefinition.SCOPE_SINGLETON); * return definition; * </pre> * * @param controllerClass * @return */ protected BeanDefinition createBeanDefinition(Class<? extends Controller> controllerClass) { // optionally configure all bean properties, like scope, prototype/singleton, etc // return new RootBeanDefinition(beanClass); return new RootBeanDefinition(controllerClass, Autowire.BY_TYPE.value(), true); }
/** * Created a bean definition for a class. * Optionally configure all bean properties, like scope, prototype/singleton, etc using: * <p/> * <pre> * BeanDefinition definition = super.createBeanDefinition(beanClass); * definition.setScope(BeanDefinition.SCOPE_SINGLETON); * return definition; * </pre> * * @param controllerClass * @return */ protected BeanDefinition createBeanDefinition(Class<? extends Controller> controllerClass) { // optionally configure all bean properties, like scope, prototype/singleton, etc // return new RootBeanDefinition(beanClass); return new RootBeanDefinition(controllerClass, Autowire.BY_TYPE.value(), true); }
/** * Build the {@link BeanWiringInfo} for the given {@link Configurable} annotation. * @param beanInstance the bean instance * @param annotation the Configurable annotation found on the bean class * @return the resolved BeanWiringInfo */ protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) { if (!Autowire.NO.equals(annotation.autowire())) { // Autowiring by name or by type return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck()); } else if (!"".equals(annotation.value())) { // Explicitly specified bean name for bean definition to take property values from return new BeanWiringInfo(annotation.value(), false); } else { // Default bean name for bean definition to take property values from return new BeanWiringInfo(getDefaultBeanName(beanInstance), true); } }
if (autowire.isAutowire()) { beanDef.setAutowireMode(autowire.value());
/** * Build the BeanWiringInfo for the given Configurable annotation. * @param beanInstance the bean instance * @param annotation the Configurable annotation found on the bean class * @return the resolved BeanWiringInfo */ protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) { if (!Autowire.NO.equals(annotation.autowire())) { return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck()); } else { if (!"".equals(annotation.value())) { // explicitly specified bean name return new BeanWiringInfo(annotation.value(), false); } else { // default bean name return new BeanWiringInfo(getDefaultBeanName(beanInstance), true); } } }
if (autowire.isAutowire()) { beanDef.setAutowireMode(autowire.value());
/** * Build the {@link BeanWiringInfo} for the given {@link Configurable} annotation. * @param beanInstance the bean instance * @param annotation the Configurable annotation found on the bean class * @return the resolved BeanWiringInfo */ protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) { if (!Autowire.NO.equals(annotation.autowire())) { // Autowiring by name or by type return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck()); } else if (!"".equals(annotation.value())) { // Explicitly specified bean name for bean definition to take property values from return new BeanWiringInfo(annotation.value(), false); } else { // Default bean name for bean definition to take property values from return new BeanWiringInfo(getDefaultBeanName(beanInstance), true); } }