Top Description Methods
org.objenesis

public Interface Objenesis

Known Direct Implementers
org.objenesis.ObjenesisBase
Imports
org.objenesis.instantiator.ObjectInstantiator

Common interface to all kind of Objenesis objects
Author
Henri Tremblay

Method Summary

Modifier and TypeMethod and Description
public <
Type to instantiate
T
>
ObjectInstantiator<T>

Returns:

Instantiator dedicated to the class
getInstantiatorOf
(Class<T>
Class to instantiate
clazz
)

Will pick the best instantiator for the provided class.

public <
Type instantiated
T
>
T

Returns:

New instance of clazz
newInstance
(Class<T>
Class to instantiate
clazz
)

Will create a new object without any constructor being called

Method Detail

getInstantiatorOfback to summary
public <T> ObjectInstantiator<T> getInstantiatorOf(Class<T> 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
<T>
Type to instantiate
clazz:Class<T>

Class to instantiate

Returns:ObjectInstantiator<T>

Instantiator dedicated to the class

newInstanceback to summary
public <T> T newInstance(Class<T> clazz)

Will create a new object without any constructor being called

Parameters
<T>
Type instantiated
clazz:Class<T>

Class to instantiate

Returns:T

New instance of clazz