Is there a way to change the value passed to a custom @Qualifier, and pass it to the delegating @Qualifier?
I understand that we can create custom qualifiers by
@Qualifier
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Van {
String value() default "";
}
And the following would pass the value "green" to @Qualifier and autowire a Vehicle bean named "green".
@Autowired
@Van("green")
Vehicle vehicle;
Let's say I have Vehicle beans created with names "greenVehicle" and "redVehicle".
Is there a way to format the value passed into @Van("green") and autowire the "greenVehicle" Vehicle bean, i.e having @Qualifier("greenVehicle") behind the scene?