站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

ObjenesisHelper (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.objenesis
Class ObjenesisHelper

java.lang.Object
  extended by org.objenesis.ObjenesisHelper

public final class ObjenesisHelper
extends Object

Use Objenesis in a static way. It is strongly not recommended to use this class.

Author:
Henri Tremblay

Method Summary
static ObjectInstantiator getInstantiatorOf(Class clazz)
          Will pick the best instantiator for the provided class.
static ObjectInstantiator getSerializableObjectInstantiatorOf(Class clazz)
          Same as getInstantiatorOf(Class) but providing an instantiator emulating ObjectInputStream.readObject behavior.
static Object newInstance(Class clazz)
          Will create a new object without any constructor being called
static Serializable newSerializableInstance(Class clazz)
          Will create an object just like it's done by ObjectInputStream.readObject (the default constructor of the first non serializable class will be called)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static final Object newInstance(Class clazz)
Will create a new object without any constructor being called

Parameters:
clazz - Class to instantiate
Returns:
New instance of clazz

newSerializableInstance

public static final Serializable newSerializableInstance(Class clazz)
Will create an object just like it's done by ObjectInputStream.readObject (the default constructor of the first non serializable class will be called)

Parameters:
clazz - Class to instantiate
Returns:
New instance of clazz

getInstantiatorOf

public static final ObjectInstantiator getInstantiatorOf(Class clazz)
Will pick the best instantiator for the provided class. If you need to create a lot of instances from the same class, it is way more efficient to create them from the same ObjectInstantiator than calling newInstance(Class).

Parameters:
clazz - Class to instantiate
Returns:
Instantiator dedicated to the class

getSerializableObjectInstantiatorOf

public static final ObjectInstantiator getSerializableObjectInstantiatorOf(Class clazz)
Same as getInstantiatorOf(Class) but providing an instantiator emulating ObjectInputStream.readObject behavior.

Parameters:
clazz - Class to instantiate
Returns:
Instantiator dedicated to the class
See Also:
newSerializableInstance(Class)


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.