Get the package name of a certain clazz

@param clazz The class you want the packagename for
@return The package name
421034
private String getPackageName(ObjectMappableAnnotatedClass clazz) {
    PackageElement pkg = elements.getPackageOf(clazz.getElement());
    return pkg.isUnnamed() ? "" : pkg.getQualifiedName().toString();
  }
19573
protected Class<?> loadClass(String clazz) throws ClassNotFoundException {
		if (this.classLoader == null){
			return Class.forName(clazz);
		}

		return Class.forName(clazz, true, this.classLoader);

	}
684931
public static String getShortClassName(String className) {
		final List<String> packages = StrUtil.split(className, CharUtil.DOT);
		if (null == packages || packages.size() < 2) {
			return className;
		}

		final int size = packages.size();
		final StringBuilder result = StrUtil.builder();
		result.append(packages.get(0).charAt(0));
		for (int i = 1; i < size - 1; i++) {
			result.append(CharUtil.DOT).append(packages.get(i).charAt(0));
		}
		result.append(CharUtil.DOT).append(packages.get(size - 1));
		return result.toString();
	}
1236021
private static String getClassName(Class<?> clazz) {
		String name = clazz.getSimpleName();
		int dotPos = name.lastIndexOf('.');
		return dotPos==-1 ? name : name.substring(dotPos+1);
	}
275966
public static String getClassFileName(Class<?> clazz) {
		Assert.notNull(clazz, "Class must not be null");
		String className = clazz.getName();
		int lastDotIndex = className.lastIndexOf(PACKAGE_SEPARATOR);
		return className.substring(lastDotIndex + 1) + CLASS_FILE_SUFFIX;
	}
587256
public static String getPackageName(String className, boolean resource)
   {
       String packageName = null;
       if (className != null)
       {
       	if (resource)
       		if (className.endsWith(PROPERTIES))
       			className = className.substring(0, className.length() - PROPERTIES.length());
           if (className.lastIndexOf('.') != -1)
               packageName = className.substring(0, className.lastIndexOf('.'));
       }
       return packageName;
   }
441229
public static String getClassPath(Class clazz){
        CodeSource codeSource = clazz.getProtectionDomain().getCodeSource();
        if(codeSource!=null)
            return URLUtil.toSystemID(codeSource.getLocation());
        else{
            URL url = clazz.getResource(clazz.getSimpleName() + ".class");
            if("jar".equals(url.getProtocol())){
                String path = url.getPath();
                try{
                    return URLUtil.toSystemID(new URL(path.substring(0, path.lastIndexOf('!'))));
                }catch(MalformedURLException ex){
                    throw new ImpossibleException("as per JAR URL Syntax this should never happen", ex);
                }
            }
            String resource = URLUtil.toSystemID(url);
            String relativePath = "/"+clazz.getName().replace(".", FileUtil.SEPARATOR)+".class";
            if(resource.endsWith(relativePath))
                resource = resource.substring(0, resource.length()-relativePath.length());
            return resource;
        }
    }
600454
public String getTeaFullClassName(Class<?> clazz) {

        if (isImplicitTeaImport(clazz)) {
            return getClassName(clazz);
        }
        
        return getFullClassName(clazz);
    }
232207
public static String stripPackageNameFromClassName(String className) {
        return (className.substring(0, className.length() - (PACKAGE_INFO_CLASS_NAME.length() + 1)));
    }
1023472
public static String simpleClassName(Class<?> clazz) {
        if (!clazz.isAnonymousClass()) {
            return clazz.getSimpleName();
        }
        // Simple name of anonymous class is empty
        String name = clazz.getName();
        int lastDot = name.lastIndexOf('.');
        if (lastDot <= 0) {
            return name;
        }
        return name.substring(lastDot + 1);
    }
355258
public String getFullClassName(String fullClassName) {

        String[] parts = parseClassName(fullClassName);             

        String className = getInnerClassName(parts[1]);
        
        if (parts[0] != null) {
            // Return the package name plus the converted class name
            return parts[0] + '.' + className;
        }
        else {
            return className;
        }
    }
673482
public static <T> ObjectName getObjectName(final Class<T> clazz)
        {
        final String domain = clazz.getPackage().getName();
        final String className = clazz.getSimpleName();
        final String objectName = domain+":type="+className;
        LOG.debug("Returning object name: {}", objectName);
        try
            {
            return new ObjectName(objectName);
            }
        catch (final MalformedObjectNameException e)
            {
            // This should never, ever happen.
            LOG.error("Invalid ObjectName: "+objectName, e);
            throw new RuntimeException("Could not create ObjectName?", e);
            }
        }
883505
public static @DottedClassName
    String extractPackageName(@DottedClassName String className) {
        int i = className.lastIndexOf('.');
        if (i < 0) {
            return "";
        }
        return className.substring(0, i);
    }
769427
public static String getPackageName(Object obj)
	{
		if(obj == null)
			throw new NullPointerException("obj is null");
		return getPackageName(obj.getClass());
	}
298974
public String getArrayClassName(Class<?> clazz) {

        if (clazz.isArray()) {
            return getArrayClassName(clazz.getComponentType()) + "[]";
        }

        return clazz.getName();
    }
740945
public static String getScriptName(Class<?> clazz) {
        return clazz == null ? null : getScriptName(clazz.getName());
    }
1332365
private static void getClassPackageNames(Class<?> clazz, Map<String, Class<?>> packageNames) {
    if (isPrivate(clazz)) {
      throw new IllegalArgumentException(PrettyPrinter.format(
          "Unable to inject an instance of %s because it is a private class.", clazz));
    } else if (!isPublic(clazz)) {
      packageNames.put(clazz.getPackage().getName(), clazz);
    }

    Class<?> enclosingClass = clazz.getEnclosingClass();
    if (enclosingClass != null) {
      getClassPackageNames(enclosingClass, packageNames);
    }
  }