本文整理了Java中org.springframework.context.annotation.Profile.value()
方法的一些代码示例,展示了Profile.value()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile.value()
方法的具体详情如下:
包路径:org.springframework.context.annotation.Profile
类名称:Profile
方法名:value
暂无
代码示例来源:origin: cloudyrock/mongock
private boolean matchesActiveSpringProfile(AnnotatedElement element) {
if (!element.isAnnotationPresent(Profile.class)) {
return true; // no-profiled changeset always matches
}
List<String> profiles = asList(element.getAnnotation(Profile.class).value());
for (String profile : profiles) {
if (profile != null && profile.length() > 0 && profile.charAt(0) == '!') {
if (!activeProfiles.contains(profile.substring(1))) {
return true;
}
} else if (activeProfiles.contains(profile)) {
return true;
}
}
return false;
}
}
代码示例来源:origin: mongobee/mongobee
private boolean matchesActiveSpringProfile(AnnotatedElement element) {
if (!ClassUtils.isPresent("org.springframework.context.annotation.Profile", null)) {
return true;
}
if (!element.isAnnotationPresent(Profile.class)) {
return true; // no-profiled changeset always matches
}
List<String> profiles = asList(element.getAnnotation(Profile.class).value());
for (String profile : profiles) {
if (profile != null && profile.length() > 0 && profile.charAt(0) == '!') {
if (!activeProfiles.contains(profile.substring(1))) {
return true;
}
} else if (activeProfiles.contains(profile)) {
return true;
}
}
return false;
}
代码示例来源:origin: com.github.mongobee/mongobee
private boolean matchesActiveSpringProfile(AnnotatedElement element) {
if (!ClassUtils.isPresent("org.springframework.context.annotation.Profile", null)) {
return true;
}
if (!element.isAnnotationPresent(Profile.class)) {
return true; // no-profiled changeset always matches
}
List<String> profiles = asList(element.getAnnotation(Profile.class).value());
for (String profile : profiles) {
if (profile != null && profile.length() > 0 && profile.charAt(0) == '!') {
if (!activeProfiles.contains(profile.substring(1))) {
return true;
}
} else if (activeProfiles.contains(profile)) {
return true;
}
}
return false;
}
内容来源于网络,如有侵权,请联系作者删除!