com.sodius.mdw.core.util
Class ClassUtils

java.lang.Object
  extended by com.sodius.mdw.core.util.ClassUtils

public final class ClassUtils
extends Object

Operations on Class.

This class cannot be instantiated or subclassed by clients.


Method Summary
static String getPackageName(Class<?> clazz)
          Gets the package name of a Class.
static String getPackageName(String className)
          Gets the package name from a String.
static String getSimpleName(Class<?> clazz)
          Gets the class name minus the package name from a Class.
static String getSimpleName(String className)
          Gets the class name minus the package name from a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSimpleName

public static String getSimpleName(Class<?> clazz)
Gets the class name minus the package name from a Class.

Parameters:
clazz - the class to get the package name for.
Returns:
the class name without the package name.

getSimpleName

public static String getSimpleName(String className)
Gets the class name minus the package name from a String.

The string passed in is assumed to be a class name - it is not checked.

Parameters:
className - the className to get the package name for.
Returns:
the class name without the package name.

getPackageName

public static String getPackageName(Class<?> clazz)
Gets the package name of a Class.

Parameters:
clazz - the class to get the package name for.
Returns:
the package name.

getPackageName

public static String getPackageName(String className)
Gets the package name from a String.

The string passed in is assumed to be a class name - it is not checked. If the class is unpackaged, return an empty string.

Parameters:
className - the className to get the package name for.
Returns:
the package name or an empty string.