com.jdon.util
类 ObjectCreator

java.lang.Object
  继承者 com.jdon.util.ObjectCreator

public final class ObjectCreator
extends Object

Creates instance of any object, given its full qualified class name is given and it has a public accessable constructor. This class is a static class it can not be instantiated

作者:
Nadia Nashi

方法摘要
static Class createClass(String className)
           
static Object createObject(Class classObject)
          Instantaite an Object instance
static Object createObject(Class classObject, Object[] params)
          Instantaite an Object instance, requires a constractor with parameters
static Object createObject(String className)
          Instantaite an Object from a given class name
static Object createObject(String className, Object[] params)
          Instantaite an Object instance, requires a constructor with parameters
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

createObject

public static Object createObject(String className)
                           throws Exception
Instantaite an Object from a given class name

参数:
className - full qualified name of the class
返回:
the instantaited Object
抛出:
Exception - if instantiation failed

createObject

public static Object createObject(Class classObject)
                           throws Exception
Instantaite an Object instance

参数:
classObject - Class object representing the object type to be instantiated
返回:
the instantaied Object
抛出:
Exception - if instantiation failed

createObject

public static Object createObject(String className,
                                  Object[] params)
                           throws Exception
Instantaite an Object instance, requires a constructor with parameters

参数:
className - full qualified name of the class
params - an array including the required parameters to instantaite the object
返回:
the instantaited Object
抛出:
Exception - if instantiation failed

createObject

public static Object createObject(Class classObject,
                                  Object[] params)
                           throws Exception
Instantaite an Object instance, requires a constractor with parameters

参数:
classObject - , Class object representing the object type to be instantiated
params - an array including the required parameters to instantaite the object
返回:
the instantaied Object
抛出:
Exception - if instantiation failed

createClass

public static Class createClass(String className)


Copyright © 2013. All Rights Reserved.