private void printTypeAnnotationsMethod(AbstractTypeDeclaration decl) {
   List<Annotation> runtimeAnnotations = ASTUtil.getRuntimeAnnotations(ASTUtil.getModifiers(decl));
   if (runtimeAnnotations.size() > 0) {
     println("+ (IOSObjectArray *)__annotations {");
     printAnnotationCreate(runtimeAnnotations);
   }
 }
  private void printParameterAnnotationMethods(MethodDeclaration method) {
    List<SingleVariableDeclaration> params = ASTUtil.getParameters(method);

    // Quick test to see if there are any parameter annotations.
    boolean hasAnnotations = false;
    for (SingleVariableDeclaration param : params) {
      List<Annotation> runtimeAnnotations =
          ASTUtil.getRuntimeAnnotations(ASTUtil.getModifiers(param));
      if (runtimeAnnotations.size() > 0) {
        hasAnnotations = true;
        break;
      }
    }

    if (hasAnnotations) {
      // Print array of arrays, with an element in the outer array for each parameter.
      printf(
          "+ (IOSObjectArray *)__annotations_%s_params {\n",
          methodKey(Types.getMethodBinding(method)));
      print("  return [IOSObjectArray arrayWithObjects:(id[]) { ");
      for (int i = 0; i < params.size(); i++) {
        if (i > 0) {
          print(", ");
        }
        SingleVariableDeclaration param = params.get(i);
        List<Annotation> runtimeAnnotations =
            ASTUtil.getRuntimeAnnotations(ASTUtil.getModifiers(param));
        if (runtimeAnnotations.size() > 0) {
          print("[IOSObjectArray arrayWithObjects:(id[]) { ");
          printAnnotations(runtimeAnnotations);
          printf(
              " } count:%d type:[IOSClass classWithProtocol:"
                  + "@protocol(JavaLangAnnotationAnnotation)]]",
              runtimeAnnotations.size());
        } else {
          print(
              "[IOSObjectArray arrayWithLength:0 "
                  + "type:[IOSClass classWithProtocol:@protocol(JavaLangAnnotationAnnotation)]]");
        }
      }
      printf(
          " } count:%d type:[IOSClass classWithProtocol:"
              + "@protocol(JavaLangAnnotationAnnotation)]];\n}\n",
          params.size());
    }
  }
 private void printMethodAnnotationMethods(List<MethodDeclaration> methods) {
   for (MethodDeclaration method : methods) {
     List<Annotation> runtimeAnnotations =
         ASTUtil.getRuntimeAnnotations(ASTUtil.getModifiers(method));
     if (runtimeAnnotations.size() > 0) {
       printf(
           "+ (IOSObjectArray *)__annotations_%s {\n", methodKey(Types.getMethodBinding(method)));
       printAnnotationCreate(runtimeAnnotations);
     }
     printParameterAnnotationMethods(method);
   }
 }
 private void printFieldAnnotationMethods(List<FieldDeclaration> fields) {
   for (FieldDeclaration field : fields) {
     List<Annotation> runtimeAnnotations =
         ASTUtil.getRuntimeAnnotations(ASTUtil.getModifiers(field));
     if (runtimeAnnotations.size() > 0) {
       for (VariableDeclarationFragment var : ASTUtil.getFragments(field)) {
         printf("+ (IOSObjectArray *)__annotations_%s_ {\n", var.getName().getIdentifier());
         printAnnotationCreate(runtimeAnnotations);
       }
     }
   }
 }