Top Description Interfaces Annotations Classes Enums
[default module]

Package org.springframework.context.annotation

Annotations
@NonNullApi
@NonNullFields
Imports
org.springframework.lang.NonNullApi, .NonNullFields

Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.

Interface Summary

Modifier and TypeInterface and Description
public interface
AnnotationConfigRegistry

Common interface for annotation config application contexts, defining register and scan methods.

public interface
Condition

A single condition that must be matched in order for a component to be registered.

public interface
ConditionContext

Context information for use by Condition implementations.

public interface
ConfigurationCondition

A Condition that offers more fine-grained control when used with @Configuration.

public interface
DeferredImportSelector

A variation of ImportSelector that runs after all @Configuration beans have been processed.

public interface
ImportAware

Interface to be implemented by any @Configuration class that wishes to be injected with the AnnotationMetadata of the @Configuration class that imported it.

public interface
ImportBeanDefinitionRegistrar

Interface to be implemented by types that register additional bean definitions when processing @Configuration classes.

pack-priv interface
ImportRegistry

Registry of imported class AnnotationMetadata.

public interface
ImportSelector

Interface to be implemented by types that determine which @Configuration class(es) should be imported based on a given selection criteria, usually one or more annotation attributes.

public interface
LoadTimeWeavingConfigurer

Interface to be implemented by @Configuration classes annotated with @EnableLoadTimeWeaving that wish to customize the LoadTimeWeaver instance to be used.

public interface
ScopeMetadataResolver

Strategy interface for resolving the scope of bean definitions.

Annotation Summary

Modifier and TypeAnnotation and Description
public @interface
Bean

Indicates that a method produces a bean to be managed by the Spring container.

public @interface
ComponentScan

Configures component scanning directives for use with @Configuration classes.

public @interface
ComponentScans

Container annotation that aggregates several ComponentScan annotations.

public @interface
Conditional

Indicates that a component is only eligible for registration when all specified conditions match.

public @interface
Configuration

Indicates that a class declares one or more @Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime, for example:

@Configuration
public class AppConfig {

    @Bean
    public MyBean myBean() {
        // instantiate, configure and return bean ...
public @interface
DependsOn

Beans on which the current bean depends.

public @interface
Description

Adds a textual description to bean definitions derived from org.springframework.stereotype.Component or Bean.

public @interface
EnableAspectJAutoProxy

Enables support for handling components marked with AspectJ's @Aspect annotation, similar to functionality found in Spring's <aop:aspectj-autoproxy> XML element.

public @interface
EnableLoadTimeWeaving

Activates a Spring LoadTimeWeaver for this application context, available as a bean with the name "loadTimeWeaver", similar to the <context:load-time-weaver> element in Spring XML.

public @interface
EnableMBeanExport

Enables default exporting of all standard MBeans from the Spring context, as well as all @ManagedResource annotated beans.

public @interface
Import

Indicates one or more component classes to import — typically @Configuration classes.

public @interface
ImportResource

Indicates one or more resources containing bean definitions to import.

public @interface
ImportRuntimeHints

Indicates that one or more RuntimeHintsRegistrar implementations should be processed.

public @interface
Lazy

Indicates whether a bean is to be lazily initialized.

public @interface
Primary

Indicates that a bean should be given preference when multiple candidates are qualified to autowire a single-valued dependency.

public @interface
Profile

Indicates that a component is eligible for registration when one or more specified profiles are active.

public @interface
PropertySource

Annotation providing a convenient and declarative mechanism for adding a PropertySource to Spring's Environment.

public @interface
PropertySources

Container annotation that aggregates several PropertySource annotations.

public @interface
Role

Indicates the 'role' hint for a given bean.

public @interface
Scope

When used as a type-level annotation in conjunction with @Component, @Scope indicates the name of a scope to use for instances of the annotated type.

Class Summary

Modifier and TypeClass and Description
public abstract class
AdviceModeImportSelector<
annotation containing AdviceMode attribute
A extends Annotation
>

Convenient base class for ImportSelector implementations that select imports based on an AdviceMode value from an annotation (such as the @Enable* annotations).

public class
AnnotatedBeanDefinitionReader

Convenient adapter for programmatic registration of bean classes.

public class
AnnotationBeanNameGenerator

BeanNameGenerator implementation for bean classes annotated with the @Component annotation or with another annotation that is itself annotated with @Component as a meta-annotation.

public class
AnnotationConfigApplicationContext

Standalone application context, accepting component classes as input — in particular @Configuration-annotated classes, but also plain @Component types and JSR-330 compliant classes using jakarta.inject annotations.

public class
AnnotationConfigBeanDefinitionParser

Parser for the <context:annotation-config/> element.

public abstract class
AnnotationConfigUtils

Utility class that allows for convenient registration of common org.springframework.beans.factory.config.BeanPostProcessor and org.springframework.beans.factory.config.BeanFactoryPostProcessor definitions for annotation-based configuration.

public class
AnnotationScopeMetadataResolver

A ScopeMetadataResolver implementation that by default checks for the presence of Spring's @Scope annotation on the bean class.

pack-priv class
AspectJAutoProxyRegistrar

Registers an AnnotationAwareAspectJAutoProxyCreator against the current BeanDefinitionRegistry as appropriate based on a given @EnableAspectJAutoProxy annotation.

public class
AutoProxyRegistrar

Registers an auto proxy creator against the current BeanDefinitionRegistry as appropriate based on an @Enable* annotation having mode and proxyTargetClass attributes set to the correct values.

pack-priv abstract class
BeanAnnotationHelper

Utilities for processing Bean-annotated methods.

pack-priv class
BeanMethod

Represents a @Configuration class method annotated with @Bean.

public class
ClassPathBeanDefinitionScanner

A bean definition scanner that detects bean candidates on the classpath, registering corresponding bean definitions with a given registry (BeanFactory or ApplicationContext).

public class
ClassPathScanningCandidateComponentProvider

A component provider that scans for candidate components starting from a specified base package.

public class
CommonAnnotationBeanPostProcessor

org.springframework.beans.factory.config.BeanPostProcessor implementation that supports common Java annotations out of the box, in particular the common annotations in the jakarta.annotation package.

pack-priv class
ComponentScanAnnotationParser

Parser for the @ComponentScan annotation.

public class
ComponentScanBeanDefinitionParser

Parser for the <context:component-scan/> element.

pack-priv class
ConditionEvaluator

Internal class used to evaluate Conditional annotations.

pack-priv class
ConfigurationClass

Represents a user-defined @Configuration class.

pack-priv class
ConfigurationClassBeanDefinitionReader

Reads a given fully-populated set of ConfigurationClass instances, registering bean definitions with the given BeanDefinitionRegistry based on its contents.

pack-priv class
ConfigurationClassEnhancer

Enhances Configuration classes by generating a CGLIB subclass which interacts with the Spring container to respect bean scoping semantics for @Bean methods.

pack-priv class
ConfigurationClassParser

Parses a Configuration class definition, populating a collection of ConfigurationClass objects (parsing a single Configuration class may result in any number of ConfigurationClass objects because one Configuration class may import another using the Import annotation).

public class
ConfigurationClassPostProcessor

BeanFactoryPostProcessor used for bootstrapping processing of @Configuration classes.

public abstract class
ConfigurationClassUtils

Utilities for identifying and configuring Configuration classes.

pack-priv abstract class
ConfigurationMethod

Base class for a @Configuration class method.

pack-priv class
ConflictingBeanDefinitionException

Marker subclass of IllegalStateException, allowing for explicit catch clauses in calling code.

public class
ContextAnnotationAutowireCandidateResolver

Complete implementation of the org.springframework.beans.factory.support.AutowireCandidateResolver strategy interface, providing support for qualifier annotations as well as for lazy resolution driven by the Lazy annotation in the context.annotation package.

public class
FullyQualifiedAnnotationBeanNameGenerator

An extension of AnnotationBeanNameGenerator that uses the fully qualified class name as the default bean name if an explicit bean name is not supplied via a supported type-level annotation such as @Component (see AnnotationBeanNameGenerator for details on supported annotations).

public class
ImportAwareAotBeanPostProcessor

A BeanPostProcessor that honours ImportAware callback using a mapping computed at build time.

public class
Jsr330ScopeMetadataResolver

Simple ScopeMetadataResolver implementation that follows JSR-330 scoping rules: defaulting to prototype scope unless jakarta.inject.Singleton is present.

public class
LoadTimeWeavingConfiguration

@Configuration class that registers a LoadTimeWeaver bean.

public class
MBeanExportConfiguration

@Configuration class that registers a AnnotationMBeanExporter bean.

pack-priv abstract class
ParserStrategyUtils

Common delegate code for the handling of parser strategies, e.g. TypeFilter, ImportSelector, ImportBeanDefinitionRegistrar

pack-priv class
ProfileCondition

Condition that matches based on the value of a @Profile annotation.

pack-priv class
PropertySourceRegistry

Registry of PropertySource processed on configuration classes.

public abstract class
ResourceElementResolver

Resolver for the injection of named beans on a field or method element, following the rules of the jakarta.annotation.Resource annotation but without any JNDI support.

public class
ScannedGenericBeanDefinition

Extension of the org.springframework.beans.factory.support.GenericBeanDefinition class, based on an ASM ClassReader, with support for annotation metadata exposed through the AnnotatedBeanDefinition interface.

pack-priv class
ScopedProxyCreator

Delegate factory class used to just introduce an AOP framework dependency when actually creating a scoped proxy.

public class
ScopeMetadata

Describes scope characteristics for a Spring-managed bean including the scope name and the scoped-proxy behavior.

public abstract class
TypeFilterUtils

Collection of utilities for working with @ComponentScan type filters.

Enum Summary

Modifier and TypeEnum and Description
public enum
AdviceMode

Enumeration used to determine whether JDK proxy-based or AspectJ weaving-based advice should be applied.

public enum
FilterType

Enumeration of the type filters that may be used in conjunction with @ComponentScan.

public enum
ScopedProxyMode

Enumerates the various scoped-proxy options.