public final class ObjenesisHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
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)
|
public static final Object newInstance(Class clazz)
clazz - Class to instantiatepublic static final Serializable newSerializableInstance(Class clazz)
clazz - Class to instantiatepublic static final ObjectInstantiator getInstantiatorOf(Class clazz)
newInstance(Class).clazz - Class to instantiatepublic static final ObjectInstantiator getSerializableObjectInstantiatorOf(Class clazz)
getInstantiatorOf(Class) but providing an instantiator emulating
ObjectInputStream.readObject behavior.clazz - Class to instantiatenewSerializableInstance(Class)Copyright © 2018. All rights reserved.