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

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

Introduction

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

Prototype

@Override
@Nullable
public String getBeanClassName() 

Source Link

Document

Return the current bean class name of this bean definition.

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  ww w .j  av  a 2 s. com
        // 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);
        }
    }
}