Class AnnotationConfigUtils
- java.lang.Object
- org.springframework.context.annotation.AnnotationConfigUtils
public abstract class AnnotationConfigUtils extends Object
Utility class that allows for convenient registration of commonBeanPostProcessorandBeanFactoryPostProcessordefinitions 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,PersistenceAnnotationBeanPostProcessor
Field Summary
Fields Modifier and Type Field Description static StringAUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed Autowired annotation processor.static StringCOMMON_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed JSR-250 annotation processor.static StringCONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed Configuration annotation processor.static StringCONFIGURATION_BEAN_NAME_GENERATORThe bean name of the internally managed BeanNameGenerator for use when processingConfigurationclasses.static StringEVENT_LISTENER_FACTORY_BEAN_NAMEThe bean name of the internally managed EventListenerFactory.static StringEVENT_LISTENER_PROCESSOR_BEAN_NAMEThe bean name of the internally managed @EventListener annotation processor.static StringPERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAMEThe bean name of the internally managed JPA annotation processor.static StringREQUIRED_ANNOTATION_PROCESSOR_BEAN_NAMEDeprecated.as of 5.1, since no Required processor is registered by default anymore
Constructor Summary
Constructors Constructor Description AnnotationConfigUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidprocessCommonDefinitionAnnotations(AnnotatedBeanDefinition abd)static voidregisterAnnotationConfigProcessors(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 processingConfigurationclasses. Set byAnnotationConfigApplicationContextandAnnotationConfigWebApplicationContextduring 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
@Deprecated public static final String REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
Deprecated.as of 5.1, since no Required processor is registered by default anymoreThe 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, @Nullable 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)