ml.shifu.guagua.util
类 ReflectionUtils

java.lang.Object
  继承者 ml.shifu.guagua.util.ReflectionUtils

public final class ReflectionUtils
extends Object

ReflectionUtils is used to get instance from java reflection mechanism.

The class should have default constructor for getting instance.

Constructors are cached but instances are not cached. Each time you will get a new instance.


方法摘要
static
<T> T
newInstance(Class<T> clazz)
          Create an object for the given class.
static
<T> T
newInstance(String name)
          Create an object for the given class.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

newInstance

public static <T> T newInstance(Class<T> clazz)
Create an object for the given class.

参数:
clazz - class of which an object is created
返回:
a new object

newInstance

public static <T> T newInstance(String name)
Create an object for the given class.

参数:
name - quarlified class name.
返回:
a new object
抛出:
GuaguaRuntimeException - In case any exception for reflection.


Copyright © 2014. All Rights Reserved.