Search in sources :

Example 1 with AttRuntimeInvisibleAnnotations

use of com.android.dx.cf.attrib.AttRuntimeInvisibleAnnotations in project buck by facebook.

the class AttributeTranslator method getAnnotations0.

/**
     * Helper method for {@link #getAnnotations} which just gets the
     * existing annotations, per se.
     *
     * @param attribs {@code non-null;} the attributes list to search in
     * @return {@code non-null;} the set of annotations, which may be empty
     */
private static Annotations getAnnotations0(AttributeList attribs) {
    AttRuntimeVisibleAnnotations visible = (AttRuntimeVisibleAnnotations) attribs.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME);
    AttRuntimeInvisibleAnnotations invisible = (AttRuntimeInvisibleAnnotations) attribs.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME);
    if (visible == null) {
        if (invisible == null) {
            return Annotations.EMPTY;
        }
        return invisible.getAnnotations();
    }
    if (invisible == null) {
        return visible.getAnnotations();
    }
    return Annotations.combine(visible.getAnnotations(), invisible.getAnnotations());
}
Also used : AttRuntimeVisibleAnnotations(com.android.dx.cf.attrib.AttRuntimeVisibleAnnotations) AttRuntimeInvisibleAnnotations(com.android.dx.cf.attrib.AttRuntimeInvisibleAnnotations)

Example 2 with AttRuntimeInvisibleAnnotations

use of com.android.dx.cf.attrib.AttRuntimeInvisibleAnnotations in project buck by facebook.

the class StdAttributeFactory method runtimeInvisibleAnnotations.

/**
     * Parses a {@code RuntimeInvisibleAnnotations} attribute.
     */
private Attribute runtimeInvisibleAnnotations(DirectClassFile cf, int offset, int length, ParseObserver observer) {
    if (length < 2) {
        throwSeverelyTruncated();
    }
    AnnotationParser ap = new AnnotationParser(cf, offset, length, observer);
    Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD);
    return new AttRuntimeInvisibleAnnotations(annotations, length);
}
Also used : AttRuntimeVisibleAnnotations(com.android.dx.cf.attrib.AttRuntimeVisibleAnnotations) AttRuntimeVisibleParameterAnnotations(com.android.dx.cf.attrib.AttRuntimeVisibleParameterAnnotations) Annotations(com.android.dx.rop.annotation.Annotations) AttRuntimeInvisibleAnnotations(com.android.dx.cf.attrib.AttRuntimeInvisibleAnnotations) AttRuntimeInvisibleParameterAnnotations(com.android.dx.cf.attrib.AttRuntimeInvisibleParameterAnnotations) AttRuntimeInvisibleAnnotations(com.android.dx.cf.attrib.AttRuntimeInvisibleAnnotations)

Aggregations

AttRuntimeInvisibleAnnotations (com.android.dx.cf.attrib.AttRuntimeInvisibleAnnotations)2 AttRuntimeVisibleAnnotations (com.android.dx.cf.attrib.AttRuntimeVisibleAnnotations)2 AttRuntimeInvisibleParameterAnnotations (com.android.dx.cf.attrib.AttRuntimeInvisibleParameterAnnotations)1 AttRuntimeVisibleParameterAnnotations (com.android.dx.cf.attrib.AttRuntimeVisibleParameterAnnotations)1 Annotations (com.android.dx.rop.annotation.Annotations)1