我刚刚修改了spring boot的配置,遇到了
@ConditionalOnProperty(prefix = "spring.social.", value = "auto-connection-views")
从 org.springframework.boot.autoconfigure.social.TwitterAutoConfiguration
@Bean(name = { "connect/twitterConnect", "connect/twitterConnected" })
@ConditionalOnProperty(prefix = "spring.social.", value = "auto-connection-views")
public View twitterConnectView() {
return new GenericConnectionStatusView("twitter", "Twitter");
}
我不了解此注释的目的。我猜想只有在属性值存在的情况下(例如“ spring.social”,“ auto-connection-views”),才可以使用bean。