Top Description Methods
org.easymock.internal

public Interface IClassInstantiator

Known Direct Implementers
org.easymock.internal.ObjenesisClassInstantiator, org.easymock.internal.DefaultClassInstantiator

Used to instantiate a given class.
Author
Henri Tremblay

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

new instance of clazz
newInstance
(Class<?>
class to instantiate
clazz
)

Return a new instance of the specified class.

Method Detail

newInstanceback to summary
public Object newInstance(Class<?> clazz) throws InstantiationException

Return a new instance of the specified class. The recommended way is without calling any constructor. This is usually done by doing like ObjectInputStream.readObject() which is JVM specific.

Parameters
clazz:Class<?>

class to instantiate

Returns:Object

new instance of clazz

Exceptions
InstantiationException:
when an error occured during instantiation