org.easymock.classextension.internal
Class DefaultClassInstantiator

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

public class DefaultClassInstantiator
extends java.lang.Object
implements IClassInstantiator

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


Constructor Summary
DefaultClassInstantiator()
           
 
Method Summary
 java.lang.Object newInstance(java.lang.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 java.lang.Object newInstance(java.lang.Class<?> c)
                             throws java.lang.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:
java.lang.InstantiationException


Copyright © 2009. All Rights Reserved.