Package org.apache.tuscany.sca.implementation.spring.elements.tie

Examples of org.apache.tuscany.sca.implementation.spring.elements.tie.SpringBeanElement


    public synchronized List<SpringBeanElement> getBeanElements() {
        if (beanElements == null) {
            beanElements = new ArrayList<SpringBeanElement>();
            for (String name : getBeanDefinitionNames()) {
                BeanDefinition def = getBeanDefinition(name);
                SpringBeanElement beanElement = new SpringBeanElement(name, def.getBeanClassName());
                beanElements.add(beanElement);
                beanElement.setAbstractBean(def.isAbstract());
                beanElement.setFactoryBeanAttribute(def.getFactoryBeanName() != null);
                beanElement.setFactoryMethodAttribute(def.getFactoryMethodName() != null);
                beanElement.setParentAttribute(def.getParentName() != null);
                beanElement.setInnerBean(beanElement.getId() == null);

                ConstructorArgumentValues args = def.getConstructorArgumentValues();
                for (Map.Entry<Integer, ValueHolder> e: args.getIndexedArgumentValues().entrySet()) {
                    ValueHolder holder = e.getValue();
                    SpringConstructorArgElement arg = new SpringConstructorArgElement(holder.getType());
                    arg.setIndex(e.getKey());
                    beanElement.addCustructorArgs(arg);
                }

                MutablePropertyValues values = def.getPropertyValues();
                for (PropertyValue p : values.getPropertyValueList()) {
                    SpringPropertyElement propertyElement = new SpringPropertyElement(p.getName());
                    Object value = p.getValue();
                    configurePropertyElement(propertyElement, value);
                    beanElement.getProperties().add(propertyElement);
                }
            }
        }
        return beanElements;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.spring.elements.tie.SpringBeanElement

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.