当前位置: 首页>>代码示例>>Java>>正文


Java AnnotatedElementUtils.isAnnotated方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:17,代码来源:StandardAnnotationMetadata.java

示例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);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:18,代码来源:StandardAnnotationMetadata.java

示例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;
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:11,代码来源:JobBeanIntrospector.java

示例5: isAnnotated

import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
@Override
public boolean isAnnotated(String annotationName) {
	return (this.annotations.length > 0 &&
			AnnotatedElementUtils.isAnnotated(getIntrospectedClass(), annotationName));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:StandardAnnotationMetadata.java

示例6: isAnnotated

import org.springframework.core.annotation.AnnotatedElementUtils; //导入方法依赖的package包/类
@Override
public boolean isAnnotated(String annotationName) {
	return AnnotatedElementUtils.isAnnotated(this.introspectedMethod, annotationName);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:StandardMethodMetadata.java


注:本文中的org.springframework.core.annotation.AnnotatedElementUtils.isAnnotated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。