JavapParser.java 文件源码

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

项目:annotation-tools 作者:
private void parseAnnotationSection(AElement member, AnnotationSection sec) throws IOException, ParseException {
    // FILL
    while (inData()) {
        String annoTypeName = parseAnnotationHead();
        RetentionPolicy retention = sec.retention;
        AnnotationBuilder ab = AnnotationFactory.saf.beginAnnotation(annoTypeName, Annotations.getRetentionPolicyMetaAnnotationSet(retention));
        if (ab == null) {
            // don't care about the result
            // but need to skip over it anyway
            parseAnnotationBody(
                    AnnotationFactory.saf.beginAnnotation(annoTypeName, Annotations.noAnnotations),
                    SECTION_DATA_PREFIX);
        } else {
            // Wrap it in a TLA with the appropriate retention policy
            Annotation a = parseAnnotationBody(ab, SECTION_DATA_PREFIX);
            // Now we need to parse the location information to determine
            // which element gets the annotation.
            AElement annoMember = chooseSubElement(member, sec);
            annoMember.tlAnnotationsHere.add(a);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号