本文整理汇总了Java中org.springframework.core.annotation.AnnotatedElementUtils.isAnnotated方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotatedElementUtils.isAnnotated方法的具体用法?Java AnnotatedElementUtils.isAnnotated怎么用?Java AnnotatedElementUtils.isAnnotated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.core.annotation.AnnotatedElementUtils
的用法示例。
在下文中一共展示了AnnotatedElementUtils.isAnnotated方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasAnnotatedMethods
import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
@Override
public boolean hasAnnotatedMethods(String annotationName) {
try {
Method[] methods = getIntrospectedClass().getDeclaredMethods();
for (Method method : methods) {
if (!method.isBridge() && method.getAnnotations().length > 0 &&
AnnotatedElementUtils.isAnnotated(method, annotationName)) {
return true;
}
}
return false;
}
catch (Throwable ex) {
throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex);
}
}
示例2: getAnnotatedMethods
import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
@Override
public Set<MethodMetadata> getAnnotatedMethods(String annotationName) {
try {
Method[] methods = getIntrospectedClass().getDeclaredMethods();
Set<MethodMetadata> annotatedMethods = new LinkedHashSet<MethodMetadata>();
for (Method method : methods) {
if (!method.isBridge() && method.getAnnotations().length > 0 &&
AnnotatedElementUtils.isAnnotated(method, annotationName)) {
annotatedMethods.add(new StandardMethodMetadata(method, this.nestedAnnotationsAsMap));
}
}
return annotatedMethods;
}
catch (Throwable ex) {
throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex);
}
}
示例3: containsNonTestComponent
import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
private boolean containsNonTestComponent(Class<?>[] classes) {
for (Class<?> candidate : classes) {
if (!AnnotatedElementUtils.isAnnotated(candidate, TestConfiguration.class)) {
return true;
}
}
return false;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:SpringBootTestContextBootstrapper.java
示例4: processDeps
import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
private static boolean processDeps(List<Dependency> deps, AnnotatedElement ao) {
if(!(AnnotatedElementUtils.isAnnotated(ao, Autowired.class))) {
return false;
}
Qualifier qualifier = AnnotatedElementUtils.getMergedAnnotation(ao, Qualifier.class);
String name = qualifier == null ? null : qualifier.value();
Class<?> type = (ao instanceof Field)? ((Field)ao).getType() : ((Method)ao).getReturnType();
deps.add(new Dependency(name, type));
return true;
}
示例5: isAnnotated
import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
@Override
public boolean isAnnotated(String annotationName) {
return (this.annotations.length > 0 &&
AnnotatedElementUtils.isAnnotated(getIntrospectedClass(), annotationName));
}
示例6: isAnnotated
import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
@Override
public boolean isAnnotated(String annotationName) {
return AnnotatedElementUtils.isAnnotated(this.introspectedMethod, annotationName);
}