Example usage for org.springframework.context.annotation ScannedGenericBeanDefinition getPropertyValues

List of usage examples for org.springframework.context.annotation ScannedGenericBeanDefinition getPropertyValues

Introduction

In this page you can find the example usage for org.springframework.context.annotation ScannedGenericBeanDefinition getPropertyValues.

Prototype

@Override
public MutablePropertyValues getPropertyValues() 

Source Link

Document

Return property values for this bean (never null ).

Usage

From source file:org.devefx.httpmapper.spring.mapper.ClassPathMapperScanner.java

private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions) {
    ScannedGenericBeanDefinition definition;
    for (BeanDefinitionHolder holder : beanDefinitions) {
        definition = (ScannedGenericBeanDefinition) holder.getBeanDefinition();

        if (logger.isDebugEnabled()) {
            logger.debug("Creating MapperFactoryBean with name '" + holder.getBeanName() + "' and '"
                    + definition.getBeanClassName() + "' mapperInterface");
        }//from   w w w .j  a v a2  s  .co m
        // the mapper interface is the original class of the bean
        // but, the actual class of the bean is MapperFactoryBean
        definition.getConstructorArgumentValues().addGenericArgumentValue(definition.getBeanClassName());
        definition.setBeanClass(this.factoryBeanClass);

        boolean explicitFactoryUsed = false;
        if (StringUtils.hasText(this.configBeanName)) {
            definition.getPropertyValues().add("config", new RuntimeBeanReference(this.configBeanName));
            explicitFactoryUsed = true;
        }

        if (!explicitFactoryUsed) {
            if (logger.isDebugEnabled()) {
                logger.debug("Enabling autowire by type for MapperFactoryBean with name '"
                        + holder.getBeanName() + "'.");
            }
            definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
        }
    }
}