org.springframework.config.java.annotation
Annotation Type Configuration


@Component
@Target(value=TYPE)
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface Configuration

Annotation indicating that a class is a "Java Configuration" class, meaning that it exposes one or more Bean methods. Holds similar information to that held in the default values of a bean factory; can generally be thought of as the JavaConfig equivalent of XML's 'beans' root element.

Note however that the information here is not used to populate the defaults of the owning bean factory, which would affect other configurations. In the style of the Java configuration mechanism generally, each Java configuration class is kept isolated.

Configuration-annotated classes are also candidates for component scanning thanks to the fact that this annotation is meta-annotated with @Component.

Author:
Rod Johnson, Chris Beams

Optional Element Summary
 boolean checkRequired
          Do we check @Required methods to make sure they've been called?
 org.springframework.beans.factory.annotation.Autowire defaultAutowire
          Specifies the default autowiring strategy.
 DependencyCheck defaultDependencyCheck
          Dependency check strategy.
 Lazy defaultLazy
          Bean instantiation strategy.
 java.lang.String[] names
          Configuration name.
 boolean useFactoryAspects
          Do we autowire with aspects from the enclosing factory scope?
 

names

public abstract java.lang.String[] names
Configuration name. Allow different variants, such as test, production etc. Default will always match.

Returns:
Default:
""

defaultAutowire

public abstract org.springframework.beans.factory.annotation.Autowire defaultAutowire
Specifies the default autowiring strategy.

Returns:
See Also:
Autowire
Default:
org.springframework.beans.factory.annotation.Autowire.INHERITED

defaultDependencyCheck

public abstract DependencyCheck defaultDependencyCheck
Dependency check strategy. By default, the dependency check is unspecified, that is the default Spring option will apply. In most cases, it means no dependency check will be done.

Returns:
See Also:
DependencyCheck
Default:
org.springframework.config.java.annotation.DependencyCheck.UNSPECIFIED

defaultLazy

public abstract Lazy defaultLazy
Bean instantiation strategy. By default, it is unspecified.

Returns:
See Also:
Lazy
Default:
org.springframework.config.java.annotation.Lazy.UNSPECIFIED

useFactoryAspects

public abstract boolean useFactoryAspects
Do we autowire with aspects from the enclosing factory scope?

Default:
false

checkRequired

public abstract boolean checkRequired
Do we check @Required methods to make sure they've been called?

Default:
false