private void addActionToIntentBuilder(
      EIntentServiceHolder holder,
      ExecutableElement executableElement,
      String methodName,
      JFieldVar actionKeyField) {
    JMethod method =
        holder.getIntentBuilderClass().method(PUBLIC, holder.getIntentBuilderClass(), methodName);
    JBlock body = method.body();

    // setAction
    body.invoke("action").arg(actionKeyField);

    // For each method params, we get put value into extras
    List<? extends VariableElement> methodParameters = executableElement.getParameters();
    if (methodParameters.size() > 0) {

      // Extras params
      for (VariableElement param : methodParameters) {
        String paramName = param.getSimpleName().toString();
        JClass parameterClass = codeModelHelper.typeMirrorToJClass(param.asType(), holder);

        JFieldVar paramVar = getStaticExtraField(holder, paramName);
        JVar methodParam = method.param(parameterClass, paramName);

        JMethod putExtraMethod =
            holder.getIntentBuilder().getPutExtraMethod(param.asType(), paramName, paramVar);
        body.invoke(putExtraMethod).arg(methodParam);
      }
    }
    body._return(JExpr._this());
  }
Example #2
0
        @Override
        public String apply(VariableElement input) {
          if (isVarArg(input.asType())) {
            return ((ArrayType) input.asType()).getComponentType() + "...";
          }

          return input.asType().toString();
        }
 @Override
 public Void visitEnumConstant(VariableElement c, JAnnotationArrayMember p) {
   JClass annotationClass = helper.typeMirrorToJClass(c.asType(), holder);
   JExpression expression = JExpr.direct(annotationClass.fullName() + "." + c.getSimpleName());
   p.param(expression);
   return null;
 }
  private void processFromProperties(TypeElement type, Set<TypeElement> types) {
    List<? extends Element> children = type.getEnclosedElements();
    VisitorConfig config = conf.getConfig(type, children);

    // fields
    if (config.visitFieldProperties()) {
      for (VariableElement field : ElementFilter.fieldsIn(children)) {
        TypeElement typeElement = typeExtractor.visit(field.asType());
        if (typeElement != null) {
          types.add(typeElement);
        }
      }
    }

    // getters
    if (config.visitMethodProperties()) {
      for (ExecutableElement method : ElementFilter.methodsIn(children)) {
        String name = method.getSimpleName().toString();
        if ((name.startsWith("get") || name.startsWith("is")) && method.getParameters().isEmpty()) {
          TypeElement typeElement = typeExtractor.visit(method.getReturnType());
          if (typeElement != null) {
            types.add(typeElement);
          }
        }
      }
    }
  }
 public void generateFieldDeclaration(VariableElement fieldElement) {
   println(
       "  {0}{1} {2};",
       generateModifierList(fieldElement.getModifiers().toArray(new Modifier[] {})),
       fieldElement.asType().toString(),
       fieldElement.getSimpleName());
 }
  private void createConstructorAndBuilder() {
    List<ExecutableElement> constructors = new ArrayList<ExecutableElement>();
    for (Element e : annotatedElement.getEnclosedElements()) {
      if (e.getKind() == CONSTRUCTOR) {
        constructors.add((ExecutableElement) e);
      }
    }

    for (ExecutableElement userConstructor : constructors) {
      JMethod copyConstructor = generatedClass.constructor(PUBLIC);
      JMethod staticHelper =
          generatedClass.method(PUBLIC | STATIC, generatedClass._extends(), "build");

      codeModelHelper.generifyStaticHelper(this, staticHelper, getAnnotatedElement());

      JBlock body = copyConstructor.body();
      JInvocation superCall = body.invoke("super");
      JInvocation newInvocation = JExpr._new(generatedClass);
      for (VariableElement param : userConstructor.getParameters()) {
        String paramName = param.getSimpleName().toString();
        JClass paramType = codeModelHelper.typeMirrorToJClass(param.asType(), this);
        copyConstructor.param(paramType, paramName);
        staticHelper.param(paramType, paramName);
        superCall.arg(JExpr.ref(paramName));
        newInvocation.arg(JExpr.ref(paramName));
      }

      JVar newCall = staticHelper.body().decl(generatedClass, "instance", newInvocation);
      staticHelper.body().invoke(newCall, getOnFinishInflate());
      staticHelper.body()._return(newCall);
      body.invoke(getInit());
    }
  }
Example #7
0
 @Override
 public void printErrorCheckMethod(
     final PrintWriter writer, final ExecutableElement method, final String tabs) {
   final Check check = method.getAnnotation(Check.class);
   if (check != null) // Get the error code from an IntBuffer output parameter
   writer.println(
         tabs + "Util.checkCLError(" + check.value() + ".get(" + check.value() + ".position()));");
   else {
     final Class return_type = Utils.getJavaType(method.getReturnType());
     if (return_type == int.class) writer.println(tabs + "Util.checkCLError(__result);");
     else {
       boolean hasErrCodeParam = false;
       for (final VariableElement param : method.getParameters()) {
         if ("errcode_ret".equals(param.getSimpleName().toString())
             && Utils.getJavaType(param.asType()) == IntBuffer.class) {
           hasErrCodeParam = true;
           break;
         }
       }
       if (hasErrCodeParam)
         throw new RuntimeException(
             "A method is missing the @Check annotation: " + method.toString());
     }
   }
 }
  @Override
  public void writeFieldReadStatement(
      VariableElement field,
      Collection<ExecutableElement> postCreateChildMethods,
      JavaWriter writer)
      throws IOException {
    DeclaredType type = (DeclaredType) field.asType();
    TypeMirror itemType = type.getTypeArguments().get(0);
    TypeMirror itemTypeErasure = processingEnv.getTypeUtils().erasure(itemType);

    String collectionInitializer;
    try {
      collectionInitializer = initializers.findCollectionInitializer(type);
    } catch (InvalidTypeException e) {
      processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, e.getMessage(), field);
      collectionInitializer = "null";
    }
    writer.beginControlFlow("if (bundle.containsKey(\"%s\"))", field.getSimpleName());
    writer.emitStatement("object.%s = %s", field.getSimpleName(), collectionInitializer);
    writer.emitStatement(
        "%1$s.readCollectionFromBundle(object.%2$s, bundle, %3$s.class, \"%2$s\")",
        CollectionBundler.class.getCanonicalName(), field.getSimpleName(), itemTypeErasure);

    writePostCreateChildMethodCalls(field, itemType, postCreateChildMethods, writer);
    writer.endControlFlow();
  }
 private void haveAfterTextChangedMethodParameters(
     ExecutableElement executableElement, IsValid valid) {
   List<? extends VariableElement> parameters = executableElement.getParameters();
   boolean editableParameterFound = false;
   boolean textViewParameterFound = false;
   for (VariableElement parameter : parameters) {
     String parameterType = parameter.asType().toString();
     if (parameterType.equals("android.text.Editable")) {
       if (editableParameterFound) {
         annotationHelper.printAnnotationError(
             executableElement,
             "Unrecognized parameter declaration. you can declare only one parameter of type android.text.Editable");
         valid.invalidate();
       }
       editableParameterFound = true;
       continue;
     }
     if (parameterType.equals("android.widget.TextView")) {
       if (textViewParameterFound) {
         annotationHelper.printAnnotationError(
             executableElement,
             "Unrecognized parameter declaration. you can declare only one parameter of type android.widget.TextView");
         valid.invalidate();
       }
       textViewParameterFound = true;
       continue;
     }
     valid.invalidate();
     annotationHelper.printAnnotationError(
         executableElement,
         "Unrecognized parameter type. %s can only have a android.widget.TextView parameter and/or an android.text.Editable parameter. See android.text.TextWatcher.afterTextChanged() for more informations.");
   }
 }
Example #10
0
 public void generateFieldDeclaration(VariableElement fieldElement, Modifier... modifiers) {
   println(
       "  {0}{1} {2};",
       generateModifierList(modifiers),
       fieldElement.asType().toString(),
       fieldElement.getSimpleName());
 }
Example #11
0
 private static void printParameterCaching(
     PrintWriter writer,
     TypeElement interface_decl,
     ExecutableElement method,
     Mode mode,
     boolean context_specific) {
   for (VariableElement param : method.getParameters()) {
     Class java_type = Utils.getJavaType(param.asType());
     CachedReference cachedReference = param.getAnnotation(CachedReference.class);
     if (Buffer.class.isAssignableFrom(java_type)
         && cachedReference != null
         && (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null)
         && param.getAnnotation(Result.class) == null) {
       writer.print("\t\tif ( LWJGLUtil.CHECKS ) StateTracker.");
       if (context_specific) {
         writer.print("getReferences(caps).");
       } else {
         writer.print("getTracker().");
       }
       if (cachedReference.name().length() > 0) {
         writer.print(cachedReference.name());
       } else {
         writer.print(Utils.getReferenceName(interface_decl, method, param));
       }
       if (cachedReference.index().length() > 0) {
         writer.print("[" + cachedReference.index() + "]");
       }
       writer.println(" = " + param.getSimpleName() + ";");
     }
   }
 }
 private void processNestedLombokTypes(
     String prefix, TypeElement element, ExecutableElement source, TypeElementMembers members) {
   for (Map.Entry<String, VariableElement> entry : members.getFields().entrySet()) {
     String name = entry.getKey();
     VariableElement field = entry.getValue();
     if (isLombokField(field, element)) {
       processNestedType(prefix, element, source, name, null, field, field.asType());
     }
   }
 }
 @Override
 public Void visitVariable(VariableElement e, Void p) {
   if (e.getAnnotation(Signaller.class) != null) {
     TypeElement typeElement = elementUtils.getTypeElement(e.asType().toString());
     if (typeElement != null) {
       handleTypeElement(typeElement);
     }
   }
   return super.visitVariable(e, p);
 }
Example #14
0
 public void generateConstantFieldDeclaration(VariableElement fieldElement) {
   if (isConstant(fieldElement)) {
     String constantValue = determineFinalConstantValue(fieldElement);
     if (constantValue != null) {
       println(
           "  {0}{1} {2} = {3};",
           generateModifierList(fieldElement.getModifiers().toArray(new Modifier[] {})),
           fieldElement.asType().toString(),
           fieldElement.getSimpleName(),
           constantValue);
     } else {
       println(
           "  {0}{1} {2};",
           generateModifierList(fieldElement.getModifiers().toArray(new Modifier[] {})),
           fieldElement.asType().toString(),
           fieldElement.getSimpleName());
     }
   }
 }
Example #15
0
 private void scanForMultipart(
     ExecutableElement executableElement, RestDocumentation.Resource.Method doc) {
   for (VariableElement var : executableElement.getParameters()) {
     TypeMirror varType = var.asType();
     if (varType.toString().startsWith(MultipartHttpServletRequest.class.getName())) {
       doc.setMultipartRequest(true);
       return;
     }
   }
 }
Example #16
0
 // 4942232:
 // check that classes exist for all the parameters of native methods
 private void checkMethodParameters(Set<TypeElement> classes) {
   Types types = processingEnv.getTypeUtils();
   for (TypeElement te : classes) {
     for (ExecutableElement ee : ElementFilter.methodsIn(te.getEnclosedElements())) {
       for (VariableElement ve : ee.getParameters()) {
         TypeMirror tm = ve.asType();
         checkMethodParametersVisitor.visit(tm, types);
       }
     }
   }
 }
 private boolean validateParametersTypes(ExecutableElement constructor) {
   boolean res = true;
   List<? extends VariableElement> parameters = constructor.getParameters();
   Iterator<TypeElement> sources = context.sources().iterator();
   for (VariableElement parameter : parameters) {
     TypeElement sourceType = sources.next();
     if (!parameter.asType().equals(sourceType.asType())) {
       res = false;
       break;
     }
   }
   return res;
 }
Example #18
0
 static Parameter forVariableElement(VariableElement variable) {
   ImmutableSet.Builder<String> qualifiers = ImmutableSet.builder();
   for (AnnotationMirror annotationMirror : variable.getAnnotationMirrors()) {
     DeclaredType annotationType = annotationMirror.getAnnotationType();
     if (annotationType.asElement().getAnnotation(Qualifier.class) != null) {
       qualifiers.add(Mirrors.getQualifiedName(annotationType).toString());
     }
   }
   return new Parameter(
       FluentIterable.from(qualifiers.build()).first(),
       variable.asType().toString(),
       variable.getSimpleName().toString());
 }
  @Override
  public void writeFieldWriteStatement(VariableElement field, JavaWriter writer)
      throws IOException {
    DeclaredType type = (DeclaredType) field.asType();
    TypeMirror itemType = type.getTypeArguments().get(0);
    TypeMirror itemTypeErasure = processingEnv.getTypeUtils().erasure(itemType);

    writer.beginControlFlow("if (object.%s != null)", field.getSimpleName());
    writer.emitStatement(
        "%1$s.writeCollectionToBundle(object.%2$s, bundle, %3$s.class, \"%2$s\")",
        CollectionBundler.class.getCanonicalName(), field.getSimpleName(), itemTypeErasure);
    writer.endControlFlow();
  }
Example #20
0
 protected String manufactureAccessorName(VariableElement fieldElement) {
   String name;
   if (fieldElement
       .asType()
       .toString()
       .equals(java.lang.Boolean.class.getSimpleName().toLowerCase())) {
     name = "is";
   } else {
     name = "get";
   }
   name += firstCharToUpperCase(fieldElement.getSimpleName().toString());
   return name;
 }
  private void addActionInOnHandleIntent(
      EIntentServiceHolder holder,
      ExecutableElement executableElement,
      String methodName,
      JFieldVar actionKeyField) {
    // If action match, call the method
    JInvocation actionCondition =
        actionKeyField.invoke("equals").arg(holder.getOnHandleIntentIntentAction());
    JBlock callActionBlock = holder.getOnHandleIntentBody()._if(actionCondition)._then();
    JInvocation callActionInvocation = JExpr._super().invoke(methodName);

    // For each method params, we get back value from extras and put it
    // in super calls
    List<? extends VariableElement> methodParameters = executableElement.getParameters();
    if (methodParameters.size() > 0) {
      // Extras
      JVar extras = callActionBlock.decl(classes().BUNDLE, "extras");
      extras.init(holder.getOnHandleIntentIntent().invoke("getExtras"));
      JBlock extrasNotNullBlock = callActionBlock._if(extras.ne(_null()))._then();

      // Extras params
      for (VariableElement param : methodParameters) {
        String paramName = param.getSimpleName().toString();
        String extraParamName = paramName + "Extra";
        JFieldVar paramVar = getStaticExtraField(holder, paramName);
        JClass extraParamClass = codeModelHelper.typeMirrorToJClass(param.asType(), holder);
        BundleHelper bundleHelper = new BundleHelper(annotationHelper, param);

        JExpression getExtraExpression =
            JExpr.invoke(extras, bundleHelper.getMethodNameToRestore()).arg(paramVar);
        if (bundleHelper.restoreCallNeedCastStatement()) {
          getExtraExpression = JExpr.cast(extraParamClass, getExtraExpression);

          if (bundleHelper.restoreCallNeedsSuppressWarning()) {
            JMethod onHandleIntentMethod = holder.getOnHandleIntentMethod();
            if (onHandleIntentMethod.annotations().size() == 0) {
              onHandleIntentMethod.annotate(SuppressWarnings.class).param("value", "unchecked");
            }
          }
        }

        JVar extraField =
            extrasNotNullBlock.decl(extraParamClass, extraParamName, getExtraExpression);
        callActionInvocation.arg(extraField);
      }
      extrasNotNullBlock.add(callActionInvocation);
    } else {
      callActionBlock.add(callActionInvocation);
    }
    callActionBlock._return();
  }
 private void processMethodsOfView(EnclosingView enclosingView, Element view) {
   List<? extends Element> enclosedElements = view.getEnclosedElements();
   for (Element e : enclosedElements) {
     System.out.println("Method process: " + e.toString());
     ViewMethod viewMethod = new ViewMethod();
     viewMethod.setMethodName(elementTools.getFieldName(e));
     viewMethod.setReturnType(((ExecutableElement) e).getReturnType());
     viewMethod.setDecorate(e.getAnnotation(NoDecorate.class) == null);
     List<? extends VariableElement> parameters = ((ExecutableElement) e).getParameters();
     for (VariableElement parameterElement : parameters) {
       viewMethod.getParameters().add(parameterElement.asType());
     }
     enclosingView.getMethods().add(viewMethod);
   }
 }
Example #23
0
 private static boolean generateParameterJava(
     PrintWriter writer,
     VariableElement param,
     TypeInfo type_info,
     boolean native_stub,
     final boolean printTypes,
     boolean first_parameter,
     Mode mode) {
   Class buffer_type = Utils.getNIOBufferType(param.asType());
   if (!first_parameter) {
     writer.print(", ");
   }
   BufferObject bo_annotation = param.getAnnotation(BufferObject.class);
   if (bo_annotation != null && mode == Mode.BUFFEROBJECT) {
     if (buffer_type == null) {
       throw new RuntimeException(
           "type of "
               + param
               + " is not a nio Buffer parameter but is annotated as buffer object");
     }
     if (printTypes) {
       writer.print("long ");
     }
     writer.print(param.getSimpleName() + Utils.BUFFER_OBJECT_PARAMETER_POSTFIX);
   } else {
     if (native_stub && param.getAnnotation(PointerWrapper.class) != null) {
       writer.print("long ");
     } else {
       Class type = type_info.getType();
       if (native_stub
           && (type == CharSequence.class
               || type == CharSequence[].class
               || type == PointerBuffer.class
               || Buffer.class.isAssignableFrom(type))) {
         writer.print("long ");
       } else if (printTypes) {
         writer.print(type.getSimpleName() + " ");
       }
     }
     AutoSize auto_size_annotation = param.getAnnotation(AutoSize.class);
     if (auto_size_annotation != null) {
       writer.print(auto_size_annotation.value() + "_");
     }
     writer.print(param.getSimpleName());
   }
   return false;
 }
Example #24
0
  /**
   * Note that to have a constant value, a field's type must be either a primitive type or String
   * otherwise the value is null.
   */
  protected String determineFinalConstantValue(VariableElement fieldElement) {
    Object fieldConstantValue = fieldElement.getConstantValue();
    String determinedConstantValue = null;

    if (fieldConstantValue instanceof java.lang.String) {
      determinedConstantValue = "\"" + String.valueOf(fieldConstantValue) + "\"";
    } else if (fieldConstantValue instanceof java.lang.Character) {
      determinedConstantValue = "'" + String.valueOf(fieldConstantValue) + "'";
    } else if (isPrimitive(fieldElement.asType())) {
      determinedConstantValue = String.valueOf(fieldConstantValue);
      if ("null".equals(determinedConstantValue)) {
        determinedConstantValue = null;
      }
    }

    return determinedConstantValue;
  }
Example #25
0
  private static String getPostfixStrippedName(
      TypeMap type_map, TypeElement interface_decl, ExecutableElement method) {
    StripPostfix strip_annotation = method.getAnnotation(StripPostfix.class);
    VariableElement postfix_parameter = Utils.findParameter(method, strip_annotation.value());
    String postfix = strip_annotation.postfix();
    boolean postfixOverride = !("NULL".equals(postfix) && strip_annotation.hasPostfix());
    if (!postfixOverride) {
      PostfixTranslator translator = new PostfixTranslator(type_map, postfix_parameter);
      postfix_parameter.asType().accept(translator, null);
      postfix = translator.getSignature();
    } else if (!strip_annotation.hasPostfix()) {
      postfix = "";
    }

    String method_name;
    Alternate alt_annotation = method.getAnnotation(Alternate.class);
    method_name =
        alt_annotation == null || alt_annotation.javaAlt()
            ? method.getSimpleName().toString()
            : alt_annotation.value();

    String extension_postfix =
        "NULL".equals(strip_annotation.extension())
            ? getExtensionPostfix(interface_decl)
            : strip_annotation.extension();

    Matcher matcher =
        getPostfixPattern(
                postfixOverride
                    ? (postfix + "(?:v)?" + extension_postfix + "$")
                    : ("(?:" + postfix + "(?:v)?|i(?:64)?_v|v)" + extension_postfix + "$"))
            .matcher(method_name);

    if (!matcher.find()) {
      throw new RuntimeException(
          method_name
              + " is specified as being postfix stripped on parameter "
              + postfix_parameter
              + ", but it's postfix is neither '"
              + postfix
              + "' nor 'v'");
    }

    return method_name.substring(0, matcher.start()) + extension_postfix;
  }
Example #26
0
 /**
  * Generates a list of Fields.
  *
  * <p><b>Usage:</b>
  *
  * <pre>
  * <code>generateFieldList(myList, true, false)</code></pre>
  *
  * <b>Generated example:</b>
  *
  * <pre>
  * <code>
  *  String myField1, int myField2, final String myField3
  * </code></pre>
  */
 public String generateFieldList(
     Collection<VariableElement> fieldElements, boolean withType, boolean leadingComma) {
   String fieldList = "";
   if (fieldElements != null && fieldElements.size() > 0) {
     int i = 0;
     for (VariableElement fieldElement : fieldElements) {
       if (leadingComma || i++ > 0) {
         fieldList += ", ";
       }
       if (withType) {
         fieldList += fieldElement.asType().toString();
         fieldList += " ";
       }
       fieldList += fieldElement.getSimpleName();
     }
   }
   return fieldList;
 }
  /**
   * @param thisPackage
   * @return List
   */
  public Set<String> getImports(final String thisPackage) {
    TreeSet<String> imports = new TreeSet<>();

    String cname = AnnUtil.getImportableClassName(returnType, thisPackage);

    if (cname != null) {
      imports.add(cname);
    }

    for (VariableElement par : pars) {
      String parType = AnnUtil.getImportableClassName(par.asType(), thisPackage);

      if (parType != null) {
        imports.add(parType);
      }
    }

    return imports;
  }
Example #28
0
    public SectorMethod build() {
      SectorMethod method = new SectorMethod();
      String methodName = methodElement.getSimpleName().toString();
      SectorOperation operationAnnotation = methodElement.getAnnotation(SectorOperation.class);
      if (operationAnnotation == null) {
        return null;
      }

      int argCount = methodElement.getParameters().size();

      method.cellbased = operationAnnotation.cellbased();
      method.name = "hz_" + methodName;

      method.returnType = methodElement.getReturnType().toString();
      method.invocationClassName =
          CodeGenerationUtils.capitalizeFirstLetter(methodName) + argCount + "Invocation";
      method.targetMethod = methodName;
      method.readonly = operationAnnotation.readonly();
      method.functionId = sectorClassModel.getMethods().size();

      List<FormalArgument> args = new LinkedList<>();

      for (VariableElement variableElement : methodElement.getParameters()) {
        FormalArgument formalArgument = new FormalArgument();
        if (method.cellbased && args.isEmpty()) {
          formalArgument.name = "id";
          formalArgument.type = "long";
        } else {
          formalArgument.name = "arg" + (args.size() + 1);
          formalArgument.type = variableElement.asType().toString();
        }
        args.add(formalArgument);
      }

      method.formalArguments = args;

      buildOriginalMethos(method);

      buildAsyncMethod(method);

      return method;
    }
Example #29
0
  private void parseShapeConstructor(ExecutableElement methodElement) {
    List<? extends VariableElement> parameters = methodElement.getParameters();

    if (superLayout != null) {
      assert parameters.size() >= superLayout.getAllShapeProperties().size();
      parameters =
          parameters.subList(superLayout.getAllShapeProperties().size(), parameters.size());
    }

    for (VariableElement element : parameters) {
      final String name = element.getSimpleName().toString();

      constructorProperties.add(name);
      final PropertyBuilder property = getProperty(name);
      setPropertyType(property, element.asType());
      parseConstructorParameterAnnotations(property, element);
      property.setIsShapeProperty(true);
      hasShapeProperties = true;
    }
  }
Example #30
0
  private void processLabels(TypeElement resourcesType, List<LabelTemplateMethod> methods) {
    for (Element element : resourcesType.getEnclosedElements()) {
      if (element.getKind() != ElementKind.METHOD) {
        continue;
      }
      final ExecutableElement method = (ExecutableElement) element;
      Message labelAnnotation = element.getAnnotation(Message.class);
      final TemplateParam returnType = new TemplateParam(method.getReturnType().toString());
      final boolean deprecated = method.getAnnotation(Deprecated.class) != null;
      final LabelTemplateMethod labelMethod;
      try {
        labelMethod =
            new LabelTemplateMethod(
                method.getSimpleName().toString(),
                deprecated,
                returnType,
                labelAnnotation.value(),
                labelAnnotation.mobile());
      } catch (Throwable t) {
        processingEnv.getMessager().printMessage(Kind.WARNING, t.getMessage(), resourcesType);
        continue;
      }

      for (VariableElement variable : method.getParameters()) {
        final String paramName = variable.getSimpleName().toString();
        final String paramType = variable.asType().toString();

        List<TemplateAnnotation> annotations = new ArrayList<TemplateAnnotation>();
        for (AnnotationMirror annotationMirrors : variable.getAnnotationMirrors()) {
          annotations.add(new TemplateAnnotation(annotationMirrors.getAnnotationType().toString()));
        }

        labelMethod.getParams().add(new TemplateParam(paramType, paramName, annotations));
      }
      methods.add(labelMethod);
    }
  }