Currently, there is a @Alternative annotation, but it also needs to be declared in XML configuration to activate a Bean at runtime.
Is it possible to design a @Conditional annotation and Condition interface like Spring to activate a CDI bean in source codes without XML declarations?
@ConditionalOnProperties
@ConditionalOnBean/ConditionalOnMissingBean
@ConditionalOnClass/CondtionalOnMissingClass
@ConditionalOnModule/CondtioinalOnMissingModule(java module)
...
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Conditional.html
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Condition.html