Utils.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:openjdk9 作者:
/**
 * Returns true if the {@code annotationDoc} is to be treated
 * as a declaration annotation, when targeting the
 * {@code elemType} element type.
 *
 * @param annotationDoc the annotationDoc to check
 * @param elemType  the targeted elemType
 * @return true if annotationDoc is a declaration annotation
 */
public boolean isDeclarationAnnotation(AnnotationTypeDoc annotationDoc,
        boolean isJava5DeclarationLocation) {
    if (!isJava5DeclarationLocation)
        return false;
    AnnotationDesc[] annotationDescList = annotationDoc.annotations();
    // Annotations with no target are treated as declaration as well
    if (annotationDescList.length==0)
        return true;
    for (AnnotationDesc anno : annotationDescList) {
        if (anno.annotationType().qualifiedName().equals(
                Target.class.getName())) {
            if (isDeclarationTarget(anno))
                return true;
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号