The binary name of the type as a String.

@param typeElement The type element
@return The class name
973107
String simpleBinaryNameFor(TypeElement typeElement) {
        Name elementBinaryName = elementUtils.getBinaryName(typeElement);
        PackageElement packageElement = elementUtils.getPackageOf(typeElement);

        String packageName = packageElement.getQualifiedName().toString();
        return elementBinaryName.toString().replaceFirst(packageName + "\\.", "");
    }
1188892
static String actualTypeParametersString(TypeElement type) {
    List<? extends TypeParameterElement> typeParameters = type.getTypeParameters();
    if (typeParameters.isEmpty()) {
      return "";
    } else {
      return typeParameters
          .stream()
          .map(e -> e.getSimpleName().toString())
          .collect(joining(", ", "<", ">"));
    }
  }
1158083
public static QualifiedName of(TypeElement type) {
    switch (type.getNestingKind()) {
      case TOP_LEVEL:
        PackageElement pkg = (PackageElement) type.getEnclosingElement();
        return QualifiedName.of(pkg.getQualifiedName().toString(), type.getSimpleName().toString());

      case MEMBER:
        List<String> reversedNames = new ArrayList<String>();
        reversedNames.add(type.getSimpleName().toString());
        Element parent = type.getEnclosingElement();
        while (parent.getKind() != ElementKind.PACKAGE) {
          reversedNames.add(parent.getSimpleName().toString());
          parent = parent.getEnclosingElement();
        }
        return new QualifiedName(
            ((PackageElement) parent).getQualifiedName().toString(),
            ImmutableList.copyOf(Lists.reverse(reversedNames)));

      default:
        throw new IllegalArgumentException("Cannot determine qualified name of " + type);
    }
  }
694349
public static String getType(final Type t) {
        switch (t.getSort()) {
        case Type.ARRAY:
            return getType(t.getElementType());
        default:
            return t.getClassName();
        }
    }
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());
  }
420912
public static String toClassName(final String type) {
        switch (type.charAt(0)) {
            case 'V':
                return CLASS_PRIMITIVE_VOID;
            case 'Z':
                return CLASS_PRIMITIVE_BOOLEAN;
            case 'C':
                return CLASS_PRIMITIVE_CHAR;
            case 'B':
                return CLASS_PRIMITIVE_BYTE;
            case 'S':
                return CLASS_PRIMITIVE_SHORT;
            case 'I':
                return CLASS_PRIMITIVE_INT;
            case 'F':
                return CLASS_PRIMITIVE_FLOAT;
            case 'J':
                return CLASS_PRIMITIVE_LONG;
            case 'D':
                return CLASS_PRIMITIVE_DOUBLE;
            case 'L':
                final int typeParamStart = type.indexOf('<');
                final int endIndex = typeParamStart >= 0 ? typeParamStart : type.indexOf(';');
                return type.substring(1, endIndex);
            case '[':
            case '+':
            case '-':
                return toClassName(type.substring(1));
            case 'T':
                // TODO handle type variables
                return CLASS_OBJECT;
            default:
                throw new IllegalArgumentException("Not a type signature: " + type);
        }
    }
570749
static final JSType getElementType(JSType iterableOrIterator, JSTypeRegistry typeRegistry) {
    TemplateTypeMap templateTypeMap =
        iterableOrIterator
            // Remember that `string` will box to a `Iterable`.
            .autobox()
            .getTemplateTypeMap();

    if (templateTypeMap.hasTemplateKey(typeRegistry.getIterableTemplate())) {
      // `Iterable<SomeElementType>` or `Generator<SomeElementType>`
      return templateTypeMap.getResolvedTemplateType(typeRegistry.getIterableTemplate());
    } else if (templateTypeMap.hasTemplateKey(typeRegistry.getIteratorTemplate())) {
      // `Iterator<SomeElementType>`
      return templateTypeMap.getResolvedTemplateType(typeRegistry.getIteratorTemplate());
    } else if (templateTypeMap.hasTemplateKey(typeRegistry.getAsyncIterableTemplate())) {
      // `AsyncIterable<SomeElementType>` or `AsyncGenerator<SomeElementType>`
      return templateTypeMap.getResolvedTemplateType(typeRegistry.getAsyncIterableTemplate());
    } else if (templateTypeMap.hasTemplateKey(typeRegistry.getAsyncIteratorTemplate())) {
      // `AsyncIterator<SomeElementType>`
      return templateTypeMap.getResolvedTemplateType(typeRegistry.getAsyncIteratorTemplate());
    }
    return typeRegistry.getNativeType(UNKNOWN_TYPE);
  }
210654
public String getTypeName(Class<?> clazz) {
		Type type = typeAnnotations.get(clazz);

		if (type != null) {
			return type.value();
		}
		return null;
	}
306402
public static String getTypeName(Class<?> clazz) {
		Type typeAnnotation = clazz.getAnnotation(Type.class);
		return typeAnnotation != null ? typeAnnotation.value() : null;
	}
58408
String getClassName(Element e) {
        // e has to be a TypeElement
        TypeElement te = (TypeElement)e;
        String packageName = elementUtils.getPackageOf(te).getQualifiedName().toString();
        String className = te.getQualifiedName().toString();
        if (className.startsWith(packageName + ".")) {
            String classAndInners = className.substring(packageName.length() + 1);
            className = packageName + "." + classAndInners.replace('.', '$');
        }
        return className;
    }
956633
public static TypeName typeName(TypeElement element, String suffix) {
		String fullName = element.getQualifiedName().toString() + suffix;

		int lastIndex = fullName.lastIndexOf(".");

		String packageName = fullName.substring(0, lastIndex);
		String className = fullName.substring(lastIndex + 1);

		return typeName(packageName, className);
	}
109021
public String getTypeGeneric(boolean includeBrackets) {
        if (isTypeGeneric() == false) {
            return "";
        }
        String result = typeGenericName[0] + typeGenericExtends[0];
        if (typeGenericExtends.length > 1) {
            result += ", " + typeGenericName[1] + typeGenericExtends[1];
            if (typeGenericExtends.length > 2) {
                result += ", " + typeGenericName[2] + typeGenericExtends[2];
            }
        }
        return includeBrackets && result.length() > 0 ? '<' + result + '>' : result;
    }
958722
public String getTypeGenericName(int typeParamIndex, boolean includeBrackets) {
        String result = typeGenericName[typeParamIndex];
        return includeBrackets && result.length() > 0 ? '<' + result + '>' : result;
    }
676433
private static String classNameOf(TypeElement type, String delimiter) {
    String name = type.getSimpleName().toString();
    while (type.getEnclosingElement() instanceof TypeElement) {
      type = (TypeElement) type.getEnclosingElement();
      name = type.getSimpleName() + delimiter + name;
    }
    return name;
  }
631219
@Nullable final TypeElement classElementFor(Element element) {
        while (element != null && !(JavaModelUtils.isClassOrInterface(element) || JavaModelUtils.isEnum(element))) {
            element = element.getEnclosingElement();
        }
        if (element instanceof  TypeElement) {
            return (TypeElement) element;
        }
        return null;
    }
1126867
public Class<?> getElementType() {
		if (Iterable.class.isAssignableFrom(type)) {
			return (Class<?>) ((ParameterizedType) getGenericType()).getActualTypeArguments()[0];
		} else {
			return type;
		}
	}
857838
Element getElement(String className) {
        int templateStart = className.indexOf('<');
        if (templateStart != -1) {
            className = className.substring(0, templateStart).trim();
        }
        return elementUtils.getTypeElement(className);
    }