Returns the name of the given type, including any enclosing types but not the package.
7599
static String classNameOf(TypeElement type) {
    String name = type.getQualifiedName().toString();
    String pkgName = packageNameOf(type);
    return pkgName.isEmpty() ? name : name.substring(pkgName.length() + 1);
  }
213706
public static <T> Collection<Class<? extends T>> getSubTypesOf(Class<T> type, String... packageNames) {
        List<Class<? extends T>> classes = getClasses(packageNames).stream()
                .filter(aClass -> type.isAssignableFrom(aClass))
                .map(aClass -> (Class<? extends T>) aClass)
                .collect(Collectors.toList()); // TODO: pass a Supplier to toList() to avoid map

        return Collections.unmodifiableCollection(classes);
    }
751407
def packageOf(self, dotted_name, packagelevel=None):
        """"""
        if '.' not in dotted_name:
            return dotted_name
        if not self.isPackage(dotted_name):
            dotted_name = '.'.join(dotted_name.split('.')[:-1])
        if packagelevel:
            dotted_name = '.'.join(dotted_name.split('.')[:packagelevel])
        return dotted_name
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;
    }
68626
public ClassName generatedTypeName(Type type) {
    ClassName abstractAdapterName = abstractAdapterName(type.type());
    return abstractAdapterName != null
        ? abstractAdapterName
        : (ClassName) typeName(type.type());
  }
1068118
public static TypeVariableName get(java.lang.reflect.TypeVariable<?> type) {
    return get(type, new LinkedHashMap<>());
  }
310630
private String getNameForType( Class<?> type )
    {
        if ( _typeToStringMap.containsKey( type ) )
        {
            return _typeToStringMap.get( type );
        }

        for ( Entry<String, Class<?>> entry : _typeMappings.entrySet() )
        {
            if ( entry.getValue().isAssignableFrom( type ) )
            {
                return entry.getKey();
            }
        }
        return null;
    }
1201220
def type_name(value):
    """"""
    return type(value).__name__ if isinstance(value, EncapsulatedNode) else \
           "struct" if isinstance(value, dict) else \
           "sequence" if isinstance(value, (tuple, list)) else \
           type(value).__name__
1219675
def get_package_id_by_type(self, package_type):
        

        mask = "mask[id, name, description, isActive, type[keyName]]"
        package = self.get_package_by_type(package_type, mask)
        if package:
            return package['id']
        else:
            raise ValueError("No package found for type: " + package_type)
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;
  }
346548
public String getEnclosingPackageName(TypeElement te) {

        PackageElement encl = configuration.utils.containingPackage(te);
        return (encl.isUnnamed()) ? "" : (encl.getQualifiedName() + ".");
    }
1162994
private static String getSimpleTypeName(TypeReference typ) {
    final Map<String, String> mapFullTypeName =
        ImmutableMap.<String, String>builder()
            .put("B", "byte")
            .put("C", "char")
            .put("D", "double")
            .put("F", "float")
            .put("I", "int")
            .put("J", "long")
            .put("S", "short")
            .put("Z", "boolean")
            .build();
    if (typ.isArrayType()) return "Array";
    String typName = typ.getName().toString();
    if (typName.startsWith("L")) {
      typName = typName.split("<")[0].substring(1); // handle generics
      typName = typName.substring(typName.lastIndexOf('/') + 1); // get unqualified name
      typName = typName.substring(typName.lastIndexOf('$') + 1); // handle inner classes
    } else {
      typName = mapFullTypeName.get(typName);
    }
    return typName;
  }
1225877
private String extractName(GroovySourceAST typeNode) {
        String typeName = buildName(typeNode);
        if (!typeName.contains("/")) {
            String slashName = "/" + typeName;
            // Groovy currently resolves this to last found so traverse in reverse order
            for (int i = importedClassesAndPackages.size() - 1; i >= 0; i--) {
                String name = importedClassesAndPackages.get(i);
                if (!aliases.containsValue(name) && name.endsWith(slashName)) {
                    typeName = name;
                    break;
                }
            }
        }
        return typeName;
    }
769592
public String enclosingTypeOrPackage() {
    int dot = string.lastIndexOf('.');
    return dot == -1 ? null : string.substring(0, dot);
  }
786393
public static String getClassName(TypeElement typeElement) {
        Name qualifiedName = typeElement.getQualifiedName();
        NestingKind nestingKind;
        try {
            nestingKind = typeElement.getNestingKind();
            if (nestingKind == NestingKind.MEMBER) {
                TypeElement enclosingElement = typeElement;
                StringBuilder builder = new StringBuilder();
                while (nestingKind == NestingKind.MEMBER) {
                    builder.insert(0, '$').insert(1, enclosingElement.getSimpleName());
                    Element enclosing = enclosingElement.getEnclosingElement();

                    if (enclosing instanceof TypeElement) {
                        enclosingElement = (TypeElement) enclosing;
                        nestingKind = enclosingElement.getNestingKind();
                    } else {
                        break;
                    }
                }
                Name enclosingName = enclosingElement.getQualifiedName();
                return enclosingName.toString() + builder;
            } else {
                return qualifiedName.toString();
            }
        } catch (RuntimeException e) {
            return qualifiedName.toString();
        }
    }
185830
public static KindName typeKindName(Type t) {
        if (t.hasTag(TYPEVAR) ||
            t.hasTag(CLASS) && (t.tsym.flags() & COMPOUND) != 0)
            return KindName.BOUND;
        else if (t.hasTag(PACKAGE))
            return KindName.PACKAGE;
        else if ((t.tsym.flags_field & ANNOTATION) != 0)
            return KindName.ANNOTATION;
        else if ((t.tsym.flags_field & INTERFACE) != 0)
            return KindName.INTERFACE;
        else
            return KindName.CLASS;
    }