【发布时间】:2022-11-25 17:38:43
【问题描述】:
我正在使用创建了以下自定义注释的库。
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@DependsOn({"springBeanUtils"})
public @interface PartyCacheable {
boolean enable() default false;
}
下面是我使用上面注释的 sn-p
@PartyCacheable(enable = false) // this value needs to be toggled from property value
public class PartyProcessing {
// some implementation
}
有没有办法根据 application.properties 文件用 true 和 false 切换 PartyCacheable 注释?
party.cache.enable=true
【问题讨论】:
标签: java spring spring-boot properties annotations