예제 #1
0
  public static CodeExecutableElement clone(
      @SuppressWarnings("unused") ProcessingEnvironment env, ExecutableElement method) {
    CodeExecutableElement copy =
        new CodeExecutableElement(method.getReturnType(), method.getSimpleName().toString());
    for (TypeMirror thrownType : method.getThrownTypes()) {
      copy.addThrownType(thrownType);
    }
    copy.setDefaultValue(method.getDefaultValue());

    for (AnnotationMirror mirror : method.getAnnotationMirrors()) {
      copy.addAnnotationMirror(mirror);
    }
    for (VariableElement var : method.getParameters()) {
      copy.addParameter(CodeVariableElement.clone(var));
    }
    for (Element element : method.getEnclosedElements()) {
      copy.add(element);
    }
    copy.getModifiers().addAll(method.getModifiers());
    copy.setVarArgs(method.isVarArgs());
    return copy;
  }
 public Boolean isVarArgs() {
   return executable.isVarArgs();
 }