Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## org.springframework.context.annotation
Annotation Type Primary

    @Target(value={TYPE,METHOD})
    @Retention(value=RUNTIME)
    @Inherited
    @Documented
    public @interface Primary

Indicates that a bean should be given preference when multiple candidates are qualified to autowire a single-valued dependency. If exactly one 'primary' bean exists among the candidates, it will be the autowired value.

May be used on any class directly or indirectly annotated with `Component` or on methods annotated with `Bean`.

Using `Primary` at the class level has no effect unless component-scanning is being used. If a `Primary`-annotated class is declared via XML, `Primary` annotation metadata is ignored, and <bean primary="true|false"/> is respected instead.

Since:
  3.0
Author:
  Chris Beams
See Also:
  `Lazy`, `Bean`, `Component`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT