Annotation annotations[] = getDeclaredAnnotations(); for(int i=0; i<annotations.length; i++) { if(annotations[i].annotationType() == annotationClass) { return annotations[i];
VM_TypeReference annotationTypeRef = VM_TypeReference.findOrCreate(annotationClass); if (runtimeVisibleAnnotations != null) { for(int i=0; i < runtimeVisibleAnnotations.length; i++) { if(runtimeVisibleAnnotations[i].annotationType() == annotationTypeRef) { return runtimeVisibleAnnotations[i].getValue(); } } } if (retainRuntimeInvisibleAnnotations && (runtimeInvisibleAnnotations != null)) { for(int i=0; i < runtimeInvisibleAnnotations.length; i++) { if(runtimeInvisibleAnnotations[i].annotationType() == annotationTypeRef) { return runtimeInvisibleAnnotations[i].getValue(); }
  public Annotation getAnnotation(Class annotationClass) {    Annotation annotations[] = getDeclaredAnnotations();    for(int i=0; i<annotations.length; i++) {      if(annotations[i].annotationType() == annotationClass) {        return annotations[i];      }    }    return null;  }