spring 自定义注解传值

@Import({WeChatInvokerConfiguration.class, WeChatImportSelector.class})
@EnableConfigurationProperties(WeChatApiConfig.class)
@EnableRetry
@EnableScheduling
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface MBootApplication {

Class<? extends WeChatTokenStore> tokenCache();

}

@MBootApplication
class A{

}

当在A类上使用注解@MBootApplication时如何在@EnableConfigurationProperties设置值


沧海一幻觉
浏览 1903回答 2
2回答

梦里花落0921

@Retention(RetentionPolicy.RUNTIME)@ContextConfigurationpublic&nbsp;@interface&nbsp;Test&nbsp;{&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;@AliasFor(value&nbsp;=&nbsp;"classes",&nbsp;annotation&nbsp;=&nbsp;ContextConfiguration.class) &nbsp;&nbsp;&nbsp;&nbsp;Class<?>[]&nbsp;t()&nbsp;default&nbsp;{}; &nbsp; }

浮云间

t就等同于@ContextConfiguration属性中的classes属性annotation(哪个注解)value(哪个属性的别名)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java