org.springframework.context.annotation
Annotation Type Configuration


@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Component
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.

Configuration is meta-annotated as a Component, therefore Configuration classes are candidates for component-scanning and may also take advantage of Autowired at the field and method but not at the constructor level. Externalized values may be wired into Configuration classes using the Value annotation.

May be used in conjunction with the Lazy annotation to indicate that all Bean methods declared within this class are by default lazily initialized.

Constraints

Since:
3.0
Author:
Rod Johnson, Chris Beams
See Also:
Import, Lazy, Bean, ConfigurationClassPostProcessor, AnnotationConfigApplicationContext

Optional Element Summary
 String value
          Explicitly specify the name of the Spring bean definition associated with this Configuration class.
 

value

public abstract String value
Explicitly specify the name of the Spring bean definition associated with this Configuration class. If left unspecified (the common case), a bean name will be automatically generated.

The custom name applies only if the Configuration class is picked up via component scanning or supplied directly to a AnnotationConfigApplicationContext. If the Configuration class is registered as a traditional XML bean definition, the name/id of the bean element will take precedence.

Returns:
the specified bean name, if any
See Also:
DefaultBeanNameGenerator
Default:
""