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:
  • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • EVENT_LISTENER_FACTORY_BEAN_NAME

      public static final String EVENT_LISTENER_FACTORY_BEAN_NAME
      The bean name of the internally managed EventListenerFactory.
      See Also:
  • Constructor Details

    • AnnotationConfigUtils

      public AnnotationConfigUtils()
  • Method Details

    • 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 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(AnnotatedBeanDefinition abd)