Package org.springframework.context.annotation

# Class AnnotationConfigUtils

java.lang.Object
org.springframework.context.annotation.AnnotationConfigUtils

public abstract class AnnotationConfigUtils extends Object
Utility class that allows for convenient registration of common `BeanPostProcessor` and `BeanFactoryPostProcessor` definitions for annotation-based configuration. Also registers a common `AutowireCandidateResolver`.

Since:
  2.5
Author:
  Mark Fisher, Juergen Hoeller, Chris Beams, Phillip Webb, Stephane Nicoll, Sam Brannen
See Also:
  - `ContextAnnotationAutowireCandidateResolver`
  - `ConfigurationClassPostProcessor`
  - `CommonAnnotationBeanPostProcessor`
  - `AutowiredAnnotationBeanPostProcessor`
  - `org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME`
The bean name of the internally managed Autowired annotation processor.
`static final String`
`COMMON_ANNOTATION_PROCESSOR_BEAN_NAME`
The bean name of the internally managed common annotation processor.
`static final String`
`CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME`
The bean name of the internally managed Configuration annotation processor.
`static final String`
`CONFIGURATION_BEAN_NAME_GENERATOR`
The bean name of the internally managed BeanNameGenerator for use when processing `Configuration` classes.
`static final String`
`EVENT_LISTENER_FACTORY_BEAN_NAME`
The bean name of the internally managed EventListenerFactory.
`static final String`
`EVENT_LISTENER_PROCESSOR_BEAN_NAME`
The bean name of the internally managed @EventListener annotation processor.
`static final String`
`PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME`
The bean name of the internally managed JPA annotation processor.

## Constructor Summary

Constructors
Constructor
Description
`AnnotationConfigUtils()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`processCommonDefinitionAnnotations(org.springframework.beans.factory.annotation.AnnotatedBeanDefinition abd)`
`static void`
`registerAnnotationConfigProcessors(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)`
Register all relevant annotation post processors in the given registry.
`static Set<org.springframework.beans.factory.config.BeanDefinitionHolder>`
`registerAnnotationConfigProcessors(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, Object source)`
Register all relevant annotation post processors in the given registry.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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 processing `Configuration` classes. Set by `AnnotationConfigApplicationContext` and `AnnotationConfigWebApplicationContext` during bootstrap in order to make any custom name generation strategy available to the underlying `ConfigurationClassPostProcessor`.

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

### COMMON_ANNOTATION_PROCESSOR_BEAN_NAME

public static final String COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed common 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 Details

### AnnotationConfigUtils

public AnnotationConfigUtils()

## Method Details

### registerAnnotationConfigProcessors

public static void registerAnnotationConfigProcessors(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Register all relevant annotation post processors in the given registry.

Parameters:
  `registry` - the registry to operate on

### registerAnnotationConfigProcessors

public static Set<org.springframework.beans.factory.config.BeanDefinitionHolder> registerAnnotationConfigProcessors(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, @Nullable Object source)
Register all relevant annotation post processors in the given registry.

Parameters:
  `registry` - the registry to operate on
  `source` - the configuration source element (already extracted) that this registration was triggered from. May be `null`.
Returns:
  a Set of BeanDefinitionHolders, containing all bean definitions that have actually been registered by this call

### processCommonDefinitionAnnotations

public static void processCommonDefinitionAnnotations(org.springframework.beans.factory.annotation.AnnotatedBeanDefinition abd)