下面列出了怎么用org.springframework.boot.SpringBootConfiguration的API类实例代码及写法,或者点击链接到github查看源代码。
private boolean isSpringBootApplication(Set<Class<?>> sources) {
for (Class<?> source : sources) {
if (AnnotatedElementUtils.hasAnnotation(source,
SpringBootConfiguration.class)) {
return true;
}
}
return false;
}
private boolean isSpringBootApplication(Set<Class<?>> sources) {
for (Class<?> source : sources) {
if (AnnotatedElementUtils.hasAnnotation(source,
SpringBootConfiguration.class)) {
return true;
}
}
return false;
}
private boolean isSpringBootApplication(Set<Class<?>> sources) {
for (Class<?> source : sources) {
if (AnnotatedElementUtils.isAnnotated(source, SpringBootConfiguration.class)) {
return true;
}
if (source.getName().endsWith("BootstrapMarkerConfiguration")) {
return true; // sigh, Spring Cloud
}
}
if (sources.contains(Object.class)) {
// TODO: find a better marker class for a Spring Init application
return true;
}
return false;
}
private boolean isSpringBootApplication(Set<Class<?>> sources) {
for (Class<?> source : sources) {
if (AnnotatedElementUtils.hasAnnotation(source,
SpringBootConfiguration.class)) {
return true;
}
}
return false;
}
private static boolean isSpringBootApplication(Class<?> startClass) {
return startClass.getDeclaredAnnotation(SpringBootApplication.class) != null
|| startClass.getDeclaredAnnotation(SpringBootConfiguration.class) != null;
}