Class AnnotationConfigUtils
- java.lang.Object
- org.springframework.context.annotation.AnnotationConfigUtils
public class AnnotationConfigUtils extends Object
Utility class that allows for convenient registration of commonBeanPostProcessor
andBeanFactoryPostProcessor
definitions for annotation-based configuration. Also registers a commonAutowireCandidateResolver
.- Since:
- 2.5
- Author:
- Mark Fisher, Juergen Hoeller, Chris Beams, Phillip Webb, Stephane Nicoll
- See Also:
ContextAnnotationAutowireCandidateResolver
,ConfigurationClassPostProcessor
,CommonAnnotationBeanPostProcessor
,AutowiredAnnotationBeanPostProcessor
,RequiredAnnotationBeanPostProcessor
,PersistenceAnnotationBeanPostProcessor
Field Summary
Fields Modifier and Type Field Description static String
AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Autowired annotation processor.static String
COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JSR-250 annotation processor.static String
CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Configuration annotation processor.static String
CONFIGURATION_BEAN_NAME_GENERATOR
The bean name of the internally managed BeanNameGenerator for use when processingConfiguration
classes.static String
EVENT_LISTENER_FACTORY_BEAN_NAME
The bean name of the internally managed EventListenerFactory.static String
EVENT_LISTENER_PROCESSOR_BEAN_NAME
The bean name of the internally managed @EventListener annotation processor.static String
PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JPA annotation processor.static String
REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Required annotation processor.
Constructor Summary
Constructors Constructor Description AnnotationConfigUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd)
static void
registerAnnotationConfigProcessors(BeanDefinitionRegistry registry)
Register all relevant annotation post processors in the given registry.static Set<BeanDefinitionHolder>
registerAnnotationConfigProcessors(BeanDefinitionRegistry registry, Object source)
Register all relevant annotation post processors in the given registry.
Field Detail
CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Configuration annotation processor.- See Also:
- Constant Field Values
CONFIGURATION_BEAN_NAME_GENERATOR
public static final String CONFIGURATION_BEAN_NAME_GENERATOR
The bean name of the internally managed BeanNameGenerator for use when processingConfiguration
classes. Set byAnnotationConfigApplicationContext
andAnnotationConfigWebApplicationContext
during bootstrap in order to make any custom name generation strategy available to the underlyingConfigurationClassPostProcessor
.- Since:
- 3.1.1
- See Also:
- Constant Field Values
AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Autowired annotation processor.- See Also:
- Constant Field Values
REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Required annotation processor.- See Also:
- Constant Field Values
COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JSR-250 annotation processor.- See Also:
- Constant Field Values
PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
public static final String PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JPA annotation processor.- See Also:
- Constant Field Values
EVENT_LISTENER_PROCESSOR_BEAN_NAME
public static final String EVENT_LISTENER_PROCESSOR_BEAN_NAME
The bean name of the internally managed @EventListener annotation processor.- See Also:
- Constant Field Values
EVENT_LISTENER_FACTORY_BEAN_NAME
public static final String EVENT_LISTENER_FACTORY_BEAN_NAME
The bean name of the internally managed EventListenerFactory.- See Also:
- Constant Field Values
Constructor Detail
AnnotationConfigUtils
public AnnotationConfigUtils()
Method Detail
registerAnnotationConfigProcessors
public static void registerAnnotationConfigProcessors(BeanDefinitionRegistry registry)
Register all relevant annotation post processors in the given registry.- Parameters:
registry
- the registry to operate on
registerAnnotationConfigProcessors
public static Set<BeanDefinitionHolder> registerAnnotationConfigProcessors(BeanDefinitionRegistry registry, Object source)
Register all relevant annotation post processors in the given registry.- Parameters:
registry
- the registry to operate onsource
- the configuration source element (already extracted) that this registration was triggered from. May benull
.- Returns:
- a Set of BeanDefinitionHolders, containing all bean definitions that have actually been registered by this call
processCommonDefinitionAnnotations
public static void processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd)