net.sf.tankbattles.reflection
Class ReflectionHelper
java.lang.Object
net.sf.tankbattles.reflection.ReflectionHelper
public class ReflectionHelper
- extends java.lang.Object
Utility class to help with class loading and instantiation.
- Author:
- erickpassos
Method Summary |
static
|
getInstance(java.lang.Class<T> clazz)
Type safe instantiation method. |
static java.lang.Class |
loadClass(java.lang.String className)
Loads a class based on a String. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionHelper
public ReflectionHelper()
loadClass
public static java.lang.Class loadClass(java.lang.String className)
- Loads a class based on a String.
Encapsulates all Exceptions.
- Parameters:
className
- that should be loaded.
- Returns:
- the Class object.
getInstance
public static <T> T getInstance(java.lang.Class<T> clazz)
- Type safe instantiation method.
- Type Parameters:
T
- the Class from which one wants an object.
- Returns:
- the type saf Object