Example usage for org.springframework.boot BeanDefinitionLoader setBeanNameGenerator

List of usage examples for org.springframework.boot BeanDefinitionLoader setBeanNameGenerator

Introduction

In this page you can find the example usage for org.springframework.boot BeanDefinitionLoader setBeanNameGenerator.

Prototype

void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) 

Source Link

Document

Set the bean name generator to be used by the underlying readers and scanner.

Usage

From source file:org.springframework.boot.SpringApplication.java

/**
 * Load beans into the application context.
 * @param context the context to load beans into
 * @param sources the sources to load//www.  j av  a2  s  .c om
 */
protected void load(ApplicationContext context, Object[] sources) {
    if (this.log.isDebugEnabled()) {
        this.log.debug("Loading source " + StringUtils.arrayToCommaDelimitedString(sources));
    }
    BeanDefinitionLoader loader = createBeanDefinitionLoader(getBeanDefinitionRegistry(context), sources);
    if (this.beanNameGenerator != null) {
        loader.setBeanNameGenerator(this.beanNameGenerator);
    }
    if (this.resourceLoader != null) {
        loader.setResourceLoader(this.resourceLoader);
    }
    if (this.environment != null) {
        loader.setEnvironment(this.environment);
    }
    loader.load();
}