public class AnnotationConfigUtils
extends java.lang.Object
BeanPostProcessor
and
BeanFactoryPostProcessor
definitions for annotation-based configuration. Also registers a common
AutowireCandidateResolver
.ContextAnnotationAutowireCandidateResolver
,
CommonAnnotationBeanPostProcessor
,
ConfigurationClassPostProcessor
,
AutowiredAnnotationBeanPostProcessor
,
RequiredAnnotationBeanPostProcessor
,
PersistenceAnnotationBeanPostProcessor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Autowired annotation processor.
|
static java.lang.String |
COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JSR-250 annotation processor.
|
static java.lang.String |
CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Configuration annotation processor.
|
static java.lang.String |
CONFIGURATION_BEAN_NAME_GENERATOR
The bean name of the internally managed BeanNameGenerator for use when processing
Configuration classes. |
static java.lang.String |
EVENT_LISTENER_FACTORY_BEAN_NAME
The bean name of the internally managed EventListenerFactory.
|
static java.lang.String |
EVENT_LISTENER_PROCESSOR_BEAN_NAME
The bean name of the internally managed @EventListener annotation processor.
|
private static boolean |
jpaPresent |
private static boolean |
jsr250Present |
static java.lang.String |
PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed JPA annotation processor.
|
private static java.lang.String |
PERSISTENCE_ANNOTATION_PROCESSOR_CLASS_NAME |
static java.lang.String |
REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
The bean name of the internally managed Required annotation processor.
|
Constructor and Description |
---|
AnnotationConfigUtils() |
Modifier and Type | Method and Description |
---|---|
private static void |
addAttributesIfNotNull(java.util.Set<AnnotationAttributes> result,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
(package private) static BeanDefinitionHolder |
applyScopedProxyMode(ScopeMetadata metadata,
BeanDefinitionHolder definition,
BeanDefinitionRegistry registry) |
(package private) static AnnotationAttributes |
attributesFor(AnnotatedTypeMetadata metadata,
java.lang.Class<?> annotationClass) |
(package private) static AnnotationAttributes |
attributesFor(AnnotatedTypeMetadata metadata,
java.lang.String annotationClassName) |
(package private) static java.util.Set<AnnotationAttributes> |
attributesForRepeatable(AnnotationMetadata metadata,
java.lang.Class<?> containerClass,
java.lang.Class<?> annotationClass) |
(package private) static java.util.Set<AnnotationAttributes> |
attributesForRepeatable(AnnotationMetadata metadata,
java.lang.String containerClassName,
java.lang.String annotationClassName) |
static void |
processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd) |
(package private) static void |
processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd,
AnnotatedTypeMetadata metadata) |
static void |
registerAnnotationConfigProcessors(BeanDefinitionRegistry registry)
Register all relevant annotation post processors in the given registry.
|
static java.util.Set<BeanDefinitionHolder> |
registerAnnotationConfigProcessors(BeanDefinitionRegistry registry,
java.lang.Object source)
Register all relevant annotation post processors in the given registry.
|
private static BeanDefinitionHolder |
registerPostProcessor(BeanDefinitionRegistry registry,
RootBeanDefinition definition,
java.lang.String beanName) |
private static DefaultListableBeanFactory |
unwrapDefaultListableBeanFactory(BeanDefinitionRegistry registry) |
public static final java.lang.String CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME
public static final java.lang.String CONFIGURATION_BEAN_NAME_GENERATOR
Configuration
classes. Set by AnnotationConfigApplicationContext
and AnnotationConfigWebApplicationContext
during bootstrap in order to make
any custom name generation strategy available to the underlying
ConfigurationClassPostProcessor
.public static final java.lang.String AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME
public static final java.lang.String REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME
public static final java.lang.String COMMON_ANNOTATION_PROCESSOR_BEAN_NAME
public static final java.lang.String PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME
private static final java.lang.String PERSISTENCE_ANNOTATION_PROCESSOR_CLASS_NAME
public static final java.lang.String EVENT_LISTENER_PROCESSOR_BEAN_NAME
public static final java.lang.String EVENT_LISTENER_FACTORY_BEAN_NAME
private static final boolean jsr250Present
private static final boolean jpaPresent
public static void registerAnnotationConfigProcessors(BeanDefinitionRegistry registry)
registry
- the registry to operate onpublic static java.util.Set<BeanDefinitionHolder> registerAnnotationConfigProcessors(BeanDefinitionRegistry registry, java.lang.Object source)
registry
- the registry to operate onsource
- the configuration source element (already extracted)
that this registration was triggered from. May be null
.private static BeanDefinitionHolder registerPostProcessor(BeanDefinitionRegistry registry, RootBeanDefinition definition, java.lang.String beanName)
private static DefaultListableBeanFactory unwrapDefaultListableBeanFactory(BeanDefinitionRegistry registry)
public static void processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd)
static void processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd, AnnotatedTypeMetadata metadata)
static BeanDefinitionHolder applyScopedProxyMode(ScopeMetadata metadata, BeanDefinitionHolder definition, BeanDefinitionRegistry registry)
static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, java.lang.Class<?> annotationClass)
static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, java.lang.String annotationClassName)
static java.util.Set<AnnotationAttributes> attributesForRepeatable(AnnotationMetadata metadata, java.lang.Class<?> containerClass, java.lang.Class<?> annotationClass)
static java.util.Set<AnnotationAttributes> attributesForRepeatable(AnnotationMetadata metadata, java.lang.String containerClassName, java.lang.String annotationClassName)
private static void addAttributesIfNotNull(java.util.Set<AnnotationAttributes> result, java.util.Map<java.lang.String,java.lang.Object> attributes)