@ Override public void setProperty ( String name , Object value ) { if ( currentBeanConfig != null ) { if ( value instanceof GString ) value = value . toString ( ) ; if ( addToDeferred ( currentBeanConfig , name , value ) ) { return ; } else if ( value instanceof Closure ) { BeanConfiguration current = currentBeanConfig ; try { Closure callable = ( Closure ) value ; Class parameterType = callable . getParameterTypes ( ) [ 0 ] ; if ( parameterType . equals ( Object . class ) ) { currentBeanConfig = springConfig . createSingletonBean ( "" ) ; callable . call ( new Object [ ] { currentBeanConfig } ) ; } else { currentBeanConfig = springConfig . createSingletonBean ( parameterType ) ; callable . call ( null ) ; } value = currentBeanConfig . getBeanDefinition ( ) ; } finally { currentBeanConfig = current ; } } currentBeanConfig . addProperty ( name , value ) ; } else { binding . put ( name , value ) ; } }
This method overrides property setting in the scope of the BeanBuilder to set properties on the current BeanConfiguration