/**
* An internal-use utility that creates a reified annotation.
* This overloaded version take annotation inheritance into account.
*/
public static <A extends Annotation> A getAnnotation(ClassSymbol annotated,
Class<A> annoType) {
boolean inherited = annoType.isAnnotationPresent(Inherited.class);
A result = null;
while (annotated.name != annotated.name.table.names.java_lang_Object) {
result = getAnnotation((Symbol)annotated, annoType);
if (result != null || !inherited)
break;
Type sup = annotated.getSuperclass();
if (sup.tag != TypeTags.CLASS || sup.isErroneous())
break;
annotated = (ClassSymbol) sup.tsym;
}
return result;
}
JavacElements.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:javaide
作者:
评论列表
文章目录