Package org.objenesis
Interface Objenesis
-
- All Known Implementing Classes:
ObjenesisBase,ObjenesisSerializer,ObjenesisStd
public interface ObjenesisCommon interface to all kind of Objenesis objects- Author:
- Henri Tremblay
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> ObjectInstantiator<T>getInstantiatorOf(java.lang.Class<T> clazz)Will pick the best instantiator for the provided class.<T> TnewInstance(java.lang.Class<T> clazz)Will create a new object without any constructor being called
-
-
-
Method Detail
-
newInstance
<T> T newInstance(java.lang.Class<T> clazz)
Will create a new object without any constructor being called- Type Parameters:
T- Type instantiated- Parameters:
clazz- Class to instantiate- Returns:
- New instance of clazz
-
getInstantiatorOf
<T> ObjectInstantiator<T> getInstantiatorOf(java.lang.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 callingnewInstance(Class).- Type Parameters:
T- Type to instantiate- Parameters:
clazz- Class to instantiate- Returns:
- Instantiator dedicated to the class
-
-