- All Known Implementing Classes:
DefaultClassInstantiator,ObjenesisClassInstantiator
public interface IClassInstantiator
Used to instantiate a given class.
- Author:
- Henri Tremblay
-
Method Summary
Modifier and TypeMethodDescriptionnewInstance(Class<?> clazz) Return a new instance of the specified class.
-
Method Details
-
newInstance
Return a new instance of the specified class. The recommended way is without calling any constructor. This is usually done by doing likeObjectInputStream.readObject()which is JVM specific.- Parameters:
clazz- class to instantiate- Returns:
- new instance of clazz
- Throws:
InstantiationException- when an error occured during instantiation
-