Annotation Interface Qualifier
@Target({FIELD,METHOD,PARAMETER,TYPE,ANNOTATION_TYPE})
@Retention(RUNTIME)
public @interface Qualifier
Annotation used to qualify the selection of a bean when multiple beans of the same type
are available for autowiring or injection.
This annotation can be applied to fields, methods, parameters, types, or other annotations to specify the qualifier value, aiding in the selection of the exact bean to be injected or autowired.
The value
attribute within @Qualifier
allows for providing a specific identifier
or qualifier string to differentiate between multiple beans of the same type. When used in conjunction
with dependency injection bring frameworks, it helps in precisely identifying the intended bean to be injected.
- Since:
- 1.0
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueSpecifies the qualifier value to differentiate between multiple beans of the same type.- Returns:
- A string value representing the qualifier or identifier for bean selection.
- Default:
""
-