Examples of ManagedList


Examples of org.springframework.beans.factory.support.ManagedList

    lbf.preInstantiateSingletons();
  }

  public void testPrototypeWithArrayConversionForConstructor() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    List list = new ManagedList();
    list.add("myName");
    list.add("myBeanName");
    RootBeanDefinition bd = new RootBeanDefinition(DerivedTestBean.class);
    bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
    bd.getConstructorArgumentValues().addGenericArgumentValue(list);
    lbf.registerBeanDefinition("test", bd);
    DerivedTestBean tb = (DerivedTestBean) lbf.getBean("test");
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

    assertEquals("myBeanName", tb2.getBeanName());
  }

  public void testPrototypeWithArrayConversionForFactoryMethod() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    List list = new ManagedList();
    list.add("myName");
    list.add("myBeanName");
    RootBeanDefinition bd = new RootBeanDefinition(DerivedTestBean.class);
    bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
    bd.setFactoryMethodName("create");
    bd.getConstructorArgumentValues().addGenericArgumentValue(list);
    lbf.registerBeanDefinition("test", bd);
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

                                         BeanDefinitionBuilder bean) {
      
        List<Element> elemList = DOMUtils.findAllElementsByTagNameNS(parent,
                                                                     name.getNamespaceURI(),
                                                                     name.getLocalPart());
        ManagedList list = new ManagedList(elemList.size());
        list.setSource(ctx.extractSource(parent));
       
        for (Element elem : elemList) {
            list.add(ctx.getDelegate().parsePropertySubElement(elem, bean.getBeanDefinition()));
        }
        return list;
    }
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

                element.getAttribute("custom-evaluator"));
            objectFactoryBeanDefinition2.getPropertyValues().addPropertyValue("expression",
                element.getAttribute("expression"));
            objectFactoryBeanDefinition.getPropertyValues().addPropertyValue("expressionConfig",
                objectFactoryBeanDefinition2);
            ManagedList list = new ManagedList<ExpressionArgument>(1);
            list.add(objectFactoryBeanDefinition2);
            builder.getBeanDefinition().getPropertyValues().addPropertyValue("arguments",
                objectFactoryBeanDefinition);
        }
    }
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

            BeanDefinitionBuilder wrapper = BeanDefinitionBuilder.genericBeanDefinition(wrapperClass);
            wrapper.addPropertyValue(propertyNameInWrapper, bean.getBeanDefinition());

            if (oldValue == null)
            {
                oldValue = new ManagedList();
                pv = new PropertyValue(newName, oldValue);
                targetProperties.addPropertyValue(pv);
            }
            if (targetConfig.isCollection(oldName))
            {
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

            PropertyValue pv = targetProperties.getPropertyValue(newName);
            Object oldValue = null == pv ? null : pv.getValue();

            if (oldValue == null)
            {
                oldValue = new ManagedList();
                pv = new PropertyValue(newName, oldValue);
                targetProperties.addPropertyValue(pv);
            }
            if (targetConfig.isCollection(oldName))
            {
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

                        // a collection of maps requires an extra intermediate object that does the
                        // lazy combination/caching of maps when first used
                        BeanDefinitionBuilder combiner = BeanDefinitionBuilder.rootBeanDefinition(MapCombiner.class);
                        targetProperties.addPropertyValue(newName, combiner.getBeanDefinition());
                        MutablePropertyValues combinerProperties = combiner.getBeanDefinition().getPropertyValues();
                        oldValue = new ManagedList();
                        pv = new PropertyValue(MapCombiner.LIST, oldValue);
                        combinerProperties.addPropertyValue(pv);
                    }
                    else
                    {
                        oldValue = new ManagedList();
                        pv = new PropertyValue(newName, oldValue);
                        targetProperties.addPropertyValue(pv);
                    }
                }
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

        {
            if (targetConfig.isCollection(propertyName))
            {
                if (null == oldValue)
                {
                    oldValue = new ManagedList();
                    pv = new PropertyValue(newName, oldValue);
                    targetProperties.addPropertyValue(pv);
                }

                List list = retrieveList(oldValue);
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

                oldValue = properties.getPropertyValue(name).getValue();
            }
            // merge collections
            if (config.isCollection() || oldValue instanceof Collection || value instanceof Collection)
            {
                Collection values = new ManagedList();
                if (null != oldValue)
                {
                    properties.removePropertyValue(name);
                    if (oldValue instanceof Collection)
                    {
                        values.addAll((Collection) oldValue);
                    }
                    else
                    {
                        values.add(oldValue);
                    }
                }
                if (value instanceof Collection)
                {
                    values.addAll((Collection) value);
                }
                else
                {
                    values.add(value);
                }
                properties.addPropertyValue(name, values);
            }
            else
            {
View Full Code Here

Examples of org.springframework.beans.factory.support.ManagedList

             pvs.hasNext();)
        {
            PropertyValue pv = (PropertyValue) pvs.next();
            map.put(pv.getName(), pv.getValue());
        }
        List list = new ManagedList();
        list.add(map);
        builder.addPropertyValue(MapCombiner.LIST, list);
        setBean(builder);
        super.insertBeanInTarget(oldName);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.