Qualifier class
Picks one bean among several of the same type, by a label or a bean name.
On a bean declaration it gives the bean that label. On an injection point it selects the bean with that label or name. Use it when several beans share a type and the one to inject is not the Primary one.
@Component()
@Qualifier('fr')
class FrenchGreeter implements Greeter { ... }
// This page is French, whatever the default greeter is.
@Service()
class Welcome {
Welcome(@Qualifier('fr') this.greeter);
final Greeter greeter;
}
Spring (Java):
@Component
@Qualifier("fr")
class FrenchGreeter implements Greeter { ... }
@Service
class Welcome {
Welcome(@Qualifier("fr") Greeter greeter) { ... }
}
Constructors
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited