net.sf.tankbattles.reflection
Class ReflectionHelper

java.lang.Object
  extended by net.sf.tankbattles.reflection.ReflectionHelper

public class ReflectionHelper
extends java.lang.Object

Utility class to help with class loading and instantiation.

Author:
erickpassos

Constructor Summary
ReflectionHelper()
           
 
Method Summary
static
<T> T
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
 

Constructor Detail

ReflectionHelper

public ReflectionHelper()
Method Detail

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