List of usage examples for org.springframework.beans.factory.config RuntimeBeanReference RuntimeBeanReference
public RuntimeBeanReference(Class<?> beanType, boolean toParent)
From source file:org.springframework.context.groovy.GroovyBeanDefinitionReader.java
/** * This method overrides property retrieval in the scope of the GroovyBeanDefinitionReader to either: * /*from w w w. j a v a 2 s . c om*/ * a) Retrieve a variable from the bean builder's binding if it exists * b) Retrieve a RuntimeBeanReference for a specific bean if it exists * c) Otherwise just delegate to super.getProperty which will resolve properties from the GroovyBeanDefinitionReader itself */ public Object getProperty(String name) { if (binding.containsKey(name)) { return binding.get(name); } else { if (namespaceHandlers.containsKey(name)) { return createDynamicElementReader(name, currentBeanConfig != null); } if (springConfig.containsBean(name)) { BeanConfiguration beanConfig = springConfig.getBeanConfig(name); if (beanConfig != null) { return new ConfigurableRuntimeBeanReference(name, springConfig.getBeanConfig(name), false); } else return new RuntimeBeanReference(name, false); } // this is to deal with the case where the property setter is the last // statement in a closure (hence the return value) else if (currentBeanConfig != null) { if (currentBeanConfig.hasProperty(name)) return currentBeanConfig.getPropertyValue(name); else { DeferredProperty dp = deferredProperties.get(currentBeanConfig.getName() + name); if (dp != null) { return dp.value; } else { return super.getProperty(name); } } } else { return super.getProperty(name); } } }