Gets the fully qualified name of the main type in this compilation unit.
427575
public static String getQualifiedMainTypeName(CompilationUnit unit) {
    PackageDeclaration pkg = unit.getPackage();
    if (pkg.isDefaultPackage()) {
      return unit.getMainTypeName();
    } else {
      return pkg.getName().getFullyQualifiedName() + '.' + unit.getMainTypeName();
    }
  }
987350
private String getNativeNameForJavaType(TypeMirror typeMirror) {
    TypeName typeName = TypeName.get(typeMirror);

    if (typeName.equals(TypeName.INT)
        || typeName.equals(TypeName.BYTE)
        || typeName.equals(TypeName.SHORT)
        || typeName.equals(TypeName.LONG)
        || typeName.equals(TypeName.FLOAT)
        || typeName.equals(TypeName.DOUBLE)) {
      return "Number";
    } else if (typeName.equals(TypeName.BOOLEAN)) {
      return "Boolean";
    } else if (typeName.equals(TypeName.get(String.class)) || typeName.equals(TypeName.CHAR)) {
      return "String";
    } else if (typeMirror.toString().startsWith(JsArray.class.getCanonicalName())) {
      return "Array";
    } else {
      return "Object";
    }
  }
927672
private String getClassName(final TypeMirror t) {
        String res = null;

        if (t instanceof DeclaredType) {
            final DeclaredType dt = (DeclaredType) t;
            res = ((TypeElement) dt.asElement()).getQualifiedName().toString();
        }

        return res;
    }
548581
public String typeName() {
        return (type instanceof ClassDoc || type instanceof TypeVariable)
                ? type.typeName()       // omit formal type params or bounds
                : type.toString();
    }
1360420
private static String getGetterName(Method m) {
        String name = m.getName();
        if (name.startsWith("get") && (name.length() >= 4)
                && ! m.getReturnType().equals(void.class)
                && (m.getParameterTypes().length == 0)
        ) {
            return Character.toLowerCase(name.charAt(3)) + name.substring(4);
        }
        if (name.startsWith("is") && (name.length() >= 3)
                && (m.getReturnType().equals(boolean.class) || m.getReturnType().equals(Boolean.class))
                && (m.getParameterTypes().length == 0)
        ) {
            return Character.toLowerCase(name.charAt(2)) + name.substring(3);
        }
        return null;
    }
1026795
private String getTypeString(Class<?> c)
   {
      String result = TYPE_MAP.get(c);
      if (result == null)
      {
         result = c.getName();
         if (!result.endsWith(";") && !result.startsWith("["))
         {
            result = "L" + result + ";";
         }
      }
      return result;
   }
1236751
def qualified_name(self):
        ''''''
        if self.module == self:
            return self.module.name
        else:
            if "." not in self.name:
                return '{0}.{1}'.format(self.module.name, self.name)
            else:
                # We have a fully qualified reference, just return it
                return self.name
279700
function getTypeName(namespace, type) {
    let namespaceName = namespace.fullName;
    let finalName;
    for (let title of type.titles) {
        let name = titleToTypeName(namespaceName, title);
        if (finalName) {
            if (name[1]) {
                // An explicit type name, so make sure it isn't masking anything
                if (finalName[1] && name[0] !== finalName[0]) {
                    // Previous explicit name from another title is different
                    throw new Error(title + '\'s override to ' + name[0]
                        + ' would shadow explicit name of ' + finalName[0]);
                }
                // Otherwise take this name since it either is the same, or overrides
                // a non-explicit name
                finalName = name;
            }
            else if (!finalName[1] && name[0].length < finalName[0].length) {
                // Take the shorter of the generated names
                finalName = name;
            }
        }
        else {
            // First valid name
            finalName = name;
        }
    }
    if (finalName) {
        return finalName;
    }
    else {
        throw new Error('Unable to generate typename for ' + type.titles[0]);
    }
}
1081001
private String inferSourceName(TypeElement type) {
    if (!ElementUtil.isPublic(type)) {
      String srcFile = ElementUtil.getSourceFile(type);
      if (srcFile != null && srcFile.endsWith(".java")) {
        int lastSlash = Math.max(srcFile.lastIndexOf('/'), srcFile.lastIndexOf('\\'));
        String baseName = lastSlash > -1 ? srcFile.substring(lastSlash + 1) : srcFile;
        return baseName.substring(0, baseName.length() - 5); // Remove .java suffix.
      }
    }
    return ElementUtil.getName(type);
  }
889935
def full_name(self):
        """"""
        if self._full_name is None:
            ancestors = [ self.name ]
            current = self.parent
            while current is not None and type(current).__name__ != "CodeParser":
                ancestors.append(current.name)
                current = current.parent

            self._full_name = ".".join(reversed(ancestors))
        
        return self._full_name
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;
    }
1052348
def fully_qualified_name(obj, sep='.'):
    """"""
    if inspect.isclass(obj):
        return obj.__module__ + sep + obj.__name__
    else:
        return obj.__module__ + sep + obj.__class__.__name__
565441
private String getTypeGenericName(Type type)
    {
        StringBuilder sb = new StringBuilder(getTypeName(type));

        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;

            Type[] generics = parameterizedType.getActualTypeArguments();
            if (generics.length > 0) {
                sb.append('<');
                for (int i = 0; i < generics.length; ++i) {
                    if (i > 0) {
                        sb.append(',');
                    }
                    sb.append(getTypeGenericName(generics[i]));
                }
                sb.append('>');
            }
        }

        return sb.toString();
    }
863937
private static String getClassFromDeclarationName(String fullDeclarationName) {
    String[] parts = fullDeclarationName.split("\\.prototype\\.");
    checkState(parts.length == 1 || parts.length == 2);
    if (parts.length == 2) {
      return parts[0];
    }
    return null;
  }
248938
def qualified_name(cls):
    
    module = cls.__module__
    if module is None or module == str.__class__.__module__:
        return cls.__name__
    return module + '.' + cls.__name__
253525
public static String getTypeName(Type type) {
		if(type instanceof Class) {
			Class<?> clazz = (Class<?>) type;
			return clazz.isArray() ? (getTypeName(clazz.getComponentType()) + "[]") : clazz.getName();
		} else {
			return type.toString();
		}
	}
600805
private static String fullQualifiedName(Tree tree) {
		if (tree.is(Tree.Kind.IDENTIFIER)) {
			return ((IdentifierTree) tree).name();
		} else if (tree.is(Tree.Kind.MEMBER_SELECT)) {
			MemberSelectExpressionTree m = (MemberSelectExpressionTree) tree;
			return fullQualifiedName(m.expression()) + "." + m.identifier().name();
		}
		throw new UnsupportedOperationException(String.format("Kind/Class '%s' not supported", tree.getClass()));
	}