Returns the TypeMirror of the ExecutableElement for all methods,
a null if constructor.
@param ee the ExecutableElement
@return
183062
public TypeMirror getReturnType(ExecutableElement ee) {
        return ee.getKind() == CONSTRUCTOR ? null : ee.getReturnType();
    }
854627
@Override
	public JvmType getType() {
		if (this.type == null) {
//			// make sure scoping has taken place and installed an IJvmTypeProvider
//			if (returnType != null)
//				returnType.getType();
			JvmType newType = TypesFactory.eINSTANCE.createJvmVoid();
			((InternalEObject)newType).eSetProxyURI(computeTypeUri(isProcedure()));
			type = (JvmType) eResolveProxy((InternalEObject) newType);
		}
		return super.getType();
	}
132116
public ASTMethod getMethod(ExecutableElement executableElement) {

        ImmutableList<ASTParameter> parameters = getParameters(executableElement.getParameters());
        ASTAccessModifier modifier = buildAccessModifier(executableElement);
        ImmutableSet<ASTType> throwsTypes = buildASTElementTypes(executableElement.getThrownTypes());

        return new ASTElementMethod(executableElement, astTypeBuilderVisitor, parameters, modifier, getAnnotations(executableElement), throwsTypes);
    }
365114
public String getReferenceSignature(ExecutableElement element) {
    StringBuilder sb = new StringBuilder("(");

    // If the method is an inner class constructor, prepend the outer class type.
    if (ElementUtil.isConstructor(element)) {
      TypeElement declaringClass = ElementUtil.getDeclaringClass(element);
      if (ElementUtil.hasOuterContext(declaringClass)) {
        TypeElement outerClass = ElementUtil.getDeclaringClass(declaringClass);
        sb.append(getSignatureName(outerClass.asType()));
      }
    }

    for (VariableElement param : element.getParameters()) {
      sb.append(getSignatureName(param.asType()));
    }

    sb.append(')');
    TypeMirror returnType = element.getReturnType();
    if (returnType != null) {
      sb.append(getSignatureName(returnType));
    }
    return sb.toString();
  }
789949
public static List<TypeName> getTypeArguments(TypeElement element) {
		final List<TypeName> result = new ArrayList<>();

		if (element.getKind() == ElementKind.CLASS) {
			if (element.getSuperclass() instanceof DeclaredType) {
				result.addAll(convert(((DeclaredType) element.getSuperclass()).getTypeArguments()));
			}
		} else if (element.getKind() == ElementKind.INTERFACE) {

			List<? extends TypeMirror> interfaces = element.getInterfaces();

			for (TypeMirror item : interfaces) {
				item.accept(new SimpleTypeVisitor7<Void, Void>() {

					@Override
					public Void visitDeclared(DeclaredType t, Void p) {
						result.addAll(convert(t.getTypeArguments()));
						return null;
					}

				}, null);

			}
		}

		return result;
	}
1057430
public static TypeMirror getApplicationSupertype(TypeElement type) {
    TypeMirror supertype = type.getSuperclass();
    return Keys.isPlatformType(supertype.toString()) ? null : supertype;
  }
1121736
public PrimitiveType getPrimitiveType(TypeMirror typeMirror) {
		if (getPrimitiveFor(typeMirror) != null) {
			return this.types.unboxedType(typeMirror);
		}
		return null;
	}
983423
@Requires({
    "type != null",
    "type.getKind() == javax.lang.model.type.TypeKind.DECLARED"
  })
  @Ensures("result == null || result.getDeclaredName().equals(type.toString())")
  ClassName getClassNameForType(TypeMirror type) {
    DeclaredType tmp = (DeclaredType) type;
    TypeElement element = (TypeElement) tmp.asElement();
    String binaryName = elementUtils.getBinaryName(element)
        .toString().replace('.', '/');
    return new ClassName(binaryName, type.toString());
  }
1096815
public TypeElement getObjcClass(TypeMirror t) {
    if (isArray(t)) {
      return getIosArray(((ArrayType) t).getComponentType());
    } else if (isDeclaredType(t)) {
      return getObjcClass((TypeElement) ((DeclaredType) t).asElement());
    }
    return null;
  }
449260
public static boolean needsSafeVarargs(TypeMirror elementType) {
    return elementType.accept(new SimpleTypeVisitor8<Boolean, Void>() {
      @Override
      public Boolean visitDeclared(DeclaredType t, Void p) {
        // Set<?>... does not need @SafeVarargs; Set<Integer>... or Set<? extends Number> does.
        for (TypeMirror typeArgument : t.getTypeArguments()) {
          if (!isPlainWildcard(typeArgument)) {
            return true;
          }
        }
        return false;
      }

      @Override
      public Boolean visitTypeVariable(TypeVariable t, Void p) {
        return true;
      }

      @Override
      protected Boolean defaultAction(TypeMirror e, Void p) {
        return false;
      }

      @Override
      public Boolean visitUnknown(TypeMirror t, Void p) {
        return false;
      }
    }, null);
  }
668693
private Set<TypeMirror> getExcludedAnnotationTypes(Element element) {
    Optional<AnnotationMirror> maybeAnnotation =
        getAnnotationMirror(element, COPY_ANNOTATIONS_NAME);
    if (!maybeAnnotation.isPresent()) {
      return ImmutableSet.of();
    }

    @SuppressWarnings("unchecked")
    List<AnnotationValue> excludedClasses =
        (List<AnnotationValue>) getAnnotationValue(maybeAnnotation.get(), "exclude").getValue();
    return excludedClasses
        .stream()
        .map(annotationValue -> (DeclaredType) annotationValue.getValue())
        .collect(toCollection(TypeMirrorSet::new));
  }
762130
private int processRemoterElements(TypeSpec.Builder classBuilder, Element element, int methodIndex, ElementVisitor elementVisitor, MethodSpec.Builder methodBuilder) {
        if (element instanceof TypeElement) {
            for (TypeMirror typeMirror : ((TypeElement) element).getInterfaces()) {
                if (typeMirror instanceof DeclaredType) {
                    Element superElement = ((DeclaredType) typeMirror).asElement();
                    methodIndex = processRemoterElements(classBuilder, superElement, methodIndex, elementVisitor, methodBuilder);
                }
            }
            for (Element member : element.getEnclosedElements()) {
                if (member.getKind() == ElementKind.METHOD) {
                    elementVisitor.visitElement(classBuilder, member, methodIndex, methodBuilder);
                    methodIndex++;
                }
            }
        }
        return methodIndex;
    }
726109
public TypeMirror overriddenType(ExecutableElement method) {
        if (utils.isStatic(method)) {
            return null;
        }
        MethodSymbol sym = (MethodSymbol)method;
        ClassSymbol origin = (ClassSymbol) sym.owner;
        for (com.sun.tools.javac.code.Type t = toolEnv.getTypes().supertype(origin.type);
                t.hasTag(com.sun.tools.javac.code.TypeTag.CLASS);
                t = toolEnv.getTypes().supertype(t)) {
            ClassSymbol c = (ClassSymbol) t.tsym;
            for (com.sun.tools.javac.code.Symbol sym2 : c.members().getSymbolsByName(sym.name)) {
                if (sym.overrides(sym2, origin, toolEnv.getTypes(), true)) {
                    return t;
                }
            }
        }
        return null;
    }
238092
public TypeMirror extractElementType(TypeMirror type) {
		if (!this.env.getTypeUtils().isAssignable(type, this.collectionType)) {
			return null;
		}
		return getCollectionElementType(type);
	}
736088
public boolean isAnnotated(ExecutableElement method) {
        List<? extends AnnotationMirror> annotationMirrors = method.getAnnotationMirrors();
        for (AnnotationMirror annotationMirror : annotationMirrors) {
            String typeName = annotationMirror.getAnnotationType().toString();
            if (!AnnotationUtil.INTERNAL_ANNOTATION_NAMES.contains(typeName)) {
                return true;
            }
        }
        return false;
    }
353999
@Nullable
    Object resolveTypeReference(Element element) {
        if (element instanceof TypeElement) {
            TypeElement typeElement = (TypeElement) element;
            return resolveTypeReferenceForTypeElement(typeElement);
        }
        return null;
    }
1070860
public TypeMirror getDeclaredType(Collection<TypeMirror> values,
            TypeElement enclosing, TypeMirror target) {
        TypeElement targetElement = asTypeElement(target);
        List<? extends TypeParameterElement> targetTypeArgs = targetElement.getTypeParameters();
        if (targetTypeArgs.isEmpty()) {
            return target;
        }

        List<? extends TypeParameterElement> enclosingTypeArgs = enclosing.getTypeParameters();
        List<TypeMirror> targetTypeArgTypes = new ArrayList<>(targetTypeArgs.size());

        if (enclosingTypeArgs.isEmpty()) {
            for (TypeMirror te : values) {
                List<? extends TypeMirror> typeArguments = ((DeclaredType)te).getTypeArguments();
                if (typeArguments.size() >= targetTypeArgs.size()) {
                    for (int i = 0 ; i < targetTypeArgs.size(); i++) {
                        targetTypeArgTypes.add(typeArguments.get(i));
                    }
                    break;
                }
            }
            // we found no matches in the hierarchy
            if (targetTypeArgTypes.isEmpty()) {
                return target;
            }
        } else {
            if (targetTypeArgs.size() > enclosingTypeArgs.size()) {
                return target;
            }
            for (int i = 0; i < targetTypeArgs.size(); i++) {
                TypeParameterElement tpe = enclosingTypeArgs.get(i);
                targetTypeArgTypes.add(tpe.asType());
            }
        }
        TypeMirror dt = typeUtils.getDeclaredType(targetElement,
                targetTypeArgTypes.toArray(new TypeMirror[targetTypeArgTypes.size()]));
        return dt;
    }