Example usage for org.springframework.context.annotation AnnotatedBeanDefinitionReader AnnotatedBeanDefinitionReader

List of usage examples for org.springframework.context.annotation AnnotatedBeanDefinitionReader AnnotatedBeanDefinitionReader

Introduction

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

Prototype

public AnnotatedBeanDefinitionReader(BeanDefinitionRegistry registry) 

Source Link

Document

Create a new AnnotatedBeanDefinitionReader for the given registry.

Usage

From source file:org.springframework.test.context.web.AnnotationConfigWebContextLoader.java

/**
 * Register classes in the supplied {@linkplain GenericWebApplicationContext context}
 * from the classes in the supplied {@link WebMergedContextConfiguration}.
 * <p>Each class must represent an <em>annotated class</em>. An
 * {@link AnnotatedBeanDefinitionReader} is used to register the appropriate
 * bean definitions.//from  w  w  w.  j  a  v  a 2s .  co  m
 * @param context the context in which the annotated classes should be registered
 * @param webMergedConfig the merged configuration from which the classes should be retrieved
 * @see AbstractGenericWebContextLoader#loadBeanDefinitions
 */
@Override
protected void loadBeanDefinitions(GenericWebApplicationContext context,
        WebMergedContextConfiguration webMergedConfig) {

    Class<?>[] annotatedClasses = webMergedConfig.getClasses();
    if (logger.isDebugEnabled()) {
        logger.debug("Registering annotated classes: " + ObjectUtils.nullSafeToString(annotatedClasses));
    }
    new AnnotatedBeanDefinitionReader(context).register(annotatedClasses);
}