/** * Create a new {@code BeanDefinitionBuilder} used to construct a {@link RootBeanDefinition}. * @param beanClassName the class name for the bean that the definition is being created for * @param factoryMethodName the name of the method to use to construct the bean instance */ public static BeanDefinitionBuilder rootBeanDefinition(String beanClassName, @Nullable String factoryMethodName) { BeanDefinitionBuilder builder = new BeanDefinitionBuilder(new RootBeanDefinition()); builder.beanDefinition.setBeanClassName(beanClassName); builder.beanDefinition.setFactoryMethodName(factoryMethodName); return builder; }
/** * Create a new {@code BeanDefinitionBuilder} used to construct a {@link RootBeanDefinition}. * @param beanClassName the class name for the bean that the definition is being created for * @param factoryMethodName the name of the method to use to construct the bean instance */ public static BeanDefinitionBuilder rootBeanDefinition(String beanClassName, @Nullable String factoryMethodName) { BeanDefinitionBuilder builder = new BeanDefinitionBuilder(new RootBeanDefinition()); builder.beanDefinition.setBeanClassName(beanClassName); builder.beanDefinition.setFactoryMethodName(factoryMethodName); return builder; }
/** * Create a new {@code BeanDefinitionBuilder} used to construct a {@link GenericBeanDefinition}. * @param beanClassName the class name for the bean that the definition is being created for */ public static BeanDefinitionBuilder genericBeanDefinition(String beanClassName) { BeanDefinitionBuilder builder = new BeanDefinitionBuilder(new GenericBeanDefinition()); builder.beanDefinition.setBeanClassName(beanClassName); return builder; }
/** * Create a new {@code BeanDefinitionBuilder} used to construct a {@link GenericBeanDefinition}. * @param beanClassName the class name for the bean that the definition is being created for */ public static BeanDefinitionBuilder genericBeanDefinition(String beanClassName) { BeanDefinitionBuilder builder = new BeanDefinitionBuilder(new GenericBeanDefinition()); builder.beanDefinition.setBeanClassName(beanClassName); return builder; }
/** * Handle the adapter-method attribute by using an * AbstractMethodInvokingDelegator */ private void handleAdapterMethodAttribute(String propertyName, String adapterClassName, MutablePropertyValues stepPvs, Element element) { String adapterMethodName = element.getAttribute("adapter-method"); if (StringUtils.hasText(adapterMethodName)) { // // Create an adapter // AbstractBeanDefinition adapterDef = new GenericBeanDefinition(); adapterDef.setBeanClassName(adapterClassName); MutablePropertyValues adapterPvs = adapterDef.getPropertyValues(); adapterPvs.addPropertyValue("targetMethod", adapterMethodName); // Inject the bean into the adapter adapterPvs.addPropertyValue("targetObject", stepPvs.getPropertyValue(propertyName).getValue()); // // Inject the adapter into the step // stepPvs.addPropertyValue(propertyName, adapterDef); } }
String beanClassName = getBeanClassName(element); if (beanClassName != null) { builder.getRawBeanDefinition().setBeanClassName(beanClassName);
String beanClassName = getBeanClassName(element); if (beanClassName != null) { builder.getRawBeanDefinition().setBeanClassName(beanClassName);
setBeanClassName(other.getBeanClassName());
setBeanClassName(other.getBeanClassName());
setBeanClassName(original.getBeanClassName()); setScope(original.getScope()); setAbstract(original.isAbstract());
/** * Create a new <code>BeanDefinitionBuilder</code> used to construct a {@link RootBeanDefinition}. * @param beanClassName the class name for the bean that the definition is being created for * @param factoryMethodName the name of the method to use to construct the bean instance */ public static BeanDefinitionBuilder rootBeanDefinition(String beanClassName, String factoryMethodName) { BeanDefinitionBuilder builder = new BeanDefinitionBuilder(); builder.beanDefinition = new RootBeanDefinition(); builder.beanDefinition.setBeanClassName(beanClassName); builder.beanDefinition.setFactoryMethodName(factoryMethodName); return builder; }
/** * Create a new <code>BeanDefinitionBuilder</code> used to construct a {@link GenericBeanDefinition}. * @param beanClassName the class name for the bean that the definition is being created for */ public static BeanDefinitionBuilder genericBeanDefinition(String beanClassName) { BeanDefinitionBuilder builder = new BeanDefinitionBuilder(); builder.beanDefinition = new GenericBeanDefinition(); builder.beanDefinition.setBeanClassName(beanClassName); return builder; }
setBeanClassName(original.getBeanClassName()); setScope(original.getScope()); setAbstract(original.isAbstract());
String beanClassName = getBeanClassName(element); if (beanClassName != null) { builder.getRawBeanDefinition().setBeanClassName(beanClassName);
setBeanClassName(other.getBeanClassName());
/** * Handle the adapter-method attribute by using an * AbstractMethodInvokingDelegator */ private void handleAdapterMethodAttribute(String propertyName, String adapterClassName, MutablePropertyValues stepPvs, Element element) { String adapterMethodName = element.getAttribute("adapter-method"); if (StringUtils.hasText(adapterMethodName)) { // // Create an adapter // AbstractBeanDefinition adapterDef = new GenericBeanDefinition(); adapterDef.setBeanClassName(adapterClassName); MutablePropertyValues adapterPvs = adapterDef.getPropertyValues(); adapterPvs.addPropertyValue("targetMethod", adapterMethodName); // Inject the bean into the adapter adapterPvs.addPropertyValue("targetObject", stepPvs.getPropertyValue(propertyName).getValue()); // // Inject the adapter into the step // stepPvs.addPropertyValue(propertyName, adapterDef); } }
/** * Handle the adapter-method attribute by using an * AbstractMethodInvokingDelegator */ private void handleAdapterMethodAttribute(String propertyName, String adapterClassName, MutablePropertyValues stepPvs, Element element) { String adapterMethodName = element.getAttribute("adapter-method"); if (StringUtils.hasText(adapterMethodName)) { // // Create an adapter // AbstractBeanDefinition adapterDef = new GenericBeanDefinition(); adapterDef.setBeanClassName(adapterClassName); MutablePropertyValues adapterPvs = adapterDef.getPropertyValues(); adapterPvs.addPropertyValue("targetMethod", adapterMethodName); // Inject the bean into the adapter adapterPvs.addPropertyValue("targetObject", stepPvs.getPropertyValue(propertyName).getValue()); // // Inject the adapter into the step // stepPvs.addPropertyValue(propertyName, adapterDef); } }
/** * Handle the adapter-method attribute by using an * AbstractMethodInvokingDelegator */ private void handleAdapterMethodAttribute(String propertyName, String adapterClassName, MutablePropertyValues stepPvs, Element element) { String adapterMethodName = element.getAttribute("adapter-method"); if (StringUtils.hasText(adapterMethodName)) { // // Create an adapter // AbstractBeanDefinition adapterDef = new GenericBeanDefinition(); adapterDef.setBeanClassName(adapterClassName); MutablePropertyValues adapterPvs = adapterDef.getPropertyValues(); adapterPvs.addPropertyValue("targetMethod", adapterMethodName); // Inject the bean into the adapter adapterPvs.addPropertyValue("targetObject", stepPvs.getPropertyValue(propertyName).getValue()); // // Inject the adapter into the step // stepPvs.addPropertyValue(propertyName, adapterDef); } }
setBeanClassName(original.getBeanClassName()); setFactoryBeanName(original.getFactoryBeanName()); setFactoryMethodName(original.getFactoryMethodName());
/** * {@inheritDoc} */ @Override protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { Object source = parserContext.extractSource(element); GenericRepositoryConfigContext configContext = new GenericRepositoryConfigContext(element); // init bean defintion parse delegate... BeanDefinitionParserDelegate delegate = new BeanDefinitionParserDelegate(parserContext.getReaderContext()); delegate.initDefaults(element.getOwnerDocument().getDocumentElement()); BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition().setAbstract(true); builder.getRawBeanDefinition().setSource(source); if (configContext.hasClazz()) { builder.getRawBeanDefinition().setBeanClassName(configContext.getClazz()); } else { // no 'class' attribute is set, so use default bean class... builder.getRawBeanDefinition().setBeanClass(defaultGenericRepositoryFactoryType); } delegate.parsePropertyElements(element, builder.getRawBeanDefinition()); return builder.getBeanDefinition(); }