在我的项目中,我创建了以下类注释:
@CustomController //created by me, it is an alias for spring's @Controller
public class AController{
}
自定义控制器的定义如下:
@Target({ElementType.TYPE, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
@Controller
public @interface CustomController{
@AliasFor(annotation = Controller.class)
String value() default "";
现在,如果至少定义了一个 @CustomController,我想实例化一个 bean 。
我找不到任何适用于这种特定情况的 @ConditionalOn* 注释,我应该创建一个自定义条件吗?怎么做?