Named class
Marks a class as a bean, or selects a bean at an injection point; the standard Java (JSR-330) name for Component and Qualifier.
On a class it behaves like @Component, on an injection point like
@Qualifier. It exists for code ported from Java that uses @Named.
@Named('fastGateway')
class FastGateway implements PaymentGateway { ... }
// Checkout always pays through the fast gateway.
@Named()
class Checkout {
Checkout(@Named('fastGateway') this.gateway);
final PaymentGateway gateway;
}
Spring (Java):
@Named("fastGateway")
class FastGateway implements PaymentGateway { ... }
@Named
class Checkout {
@Inject
Checkout(@Named("fastGateway") PaymentGateway gateway) { ... }
}
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