org.easymock.internal
Class DefaultClassInstantiator

java.lang.Object
  extended by org.easymock.internal.DefaultClassInstantiator
All Implemented Interfaces:
IClassInstantiator

public class DefaultClassInstantiator
extends Object
implements IClassInstantiator

Default class instantiator that is pretty limited. It just hope that the mocked class has a public empty constructor.

Author:
Henri Tremblay

Constructor Summary
DefaultClassInstantiator()
           
 
Method Summary
 Object newInstance(Class<?> c)
          Try to instantiate a class without using a special constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClassInstantiator

public DefaultClassInstantiator()
Method Detail

newInstance

public Object newInstance(Class<?> c)
                   throws InstantiationException
Try to instantiate a class without using a special constructor. See documentation for the algorithm.

Specified by:
newInstance in interface IClassInstantiator
Parameters:
c - Class to instantiate
Returns:
new instance of clazz
Throws:
InstantiationException


Copyright © 2001-2011 OFFIS, Tammo Freese, Henri Tremblay. All Rights Reserved.