public BeanDefinitionInfo toDto ( BeanDefinition beanDefinition ) { if ( beanDefinition instanceof GenericBeanDefinition ) { GenericBeanDefinitionInfo info = new GenericBeanDefinitionInfo ( ) ; info . setClassName ( beanDefinition . getBeanClassName ( ) ) ; if ( beanDefinition . getPropertyValues ( ) != null ) { Map < String , BeanMetadataElementInfo > propertyValues = new HashMap < String , BeanMetadataElementInfo > ( ) ; for ( PropertyValue value : beanDefinition . getPropertyValues ( ) . getPropertyValueList ( ) ) { Object obj = value . getValue ( ) ; if ( obj instanceof BeanMetadataElement ) { propertyValues . put ( value . getName ( ) , toDto ( ( BeanMetadataElement ) obj ) ) ; } else { throw new IllegalArgumentException ( "Type " + obj . getClass ( ) . getName ( ) + " is not a BeanMetadataElement for property: " + value . getName ( ) ) ; } } info . setPropertyValues ( propertyValues ) ; } return info ; } else { throw new IllegalArgumentException ( "Conversion to DTO of " + beanDefinition . getClass ( ) . getName ( ) + " not implemented" ) ; } }
Convert from an internal Spring bean definition to a DTO .