public static Annotations getClassAnnotations(DirectClassFile cf, CfOptions args) {
    CstType thisClass = cf.getThisClass();
    AttributeList attribs = cf.getAttributes();
    Annotations result = getAnnotations(attribs);
    Annotation enclosingMethod = translateEnclosingMethod(attribs);

    try {
      Annotations innerClassAnnotations =
          translateInnerClasses(thisClass, attribs, enclosingMethod == null);
      if (innerClassAnnotations != null) {
        result = Annotations.combine(result, innerClassAnnotations);
      }
    } catch (Warning warn) {
      args.warn.println("warning: " + warn.getMessage());
    }

    if (enclosingMethod != null) {
      result = Annotations.combine(result, enclosingMethod);
    }

    if (AccessFlags.isAnnotation(cf.getAccessFlags())) {
      Annotation annotationDefault = translateAnnotationDefaults(cf);
      if (annotationDefault != null) {
        result = Annotations.combine(result, annotationDefault);
      }
    }

    return result;
  }
Gets the annotations out of a given class, similar to {@link #getAnnotations}, also including
annotations for translations of class-level attributes {@code EnclosingMethod} and {@code
InnerClasses}, if present. Additionally, if the class is an annotation class, then this also
includes a representation of all the {@code AnnotationDefault} values.

@param cf {@code non-null;} the class in question
@param args {@code non-null;} the high-level options
@return {@code non-null;} the set of annotations, which may be empty
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/cf/AttributeTranslator.java