ClassProxyFactory (EasyMock 3.2 API)
Date: 2013-07-11

org.easymock.internal

## Class ClassProxyFactory

- java.lang.Object
- - org.easymock.internal.ClassProxyFactory

- All Implemented Interfaces:
    IProxyFactory

      public class ClassProxyFactory
      extends Object
      implements IProxyFactory

  Factory generating a mock for a class.
  Author:
    Henri Tremblay

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ClassProxyFactory.MockMethodInterceptor`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClassProxyFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `createProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs args)`
    `InvocationHandler` | `getInvocationHandler(Object mock)` Returns the invocation handler for `mock`;
    `static boolean` | `isCallerMockInvocationHandlerInvoke(Throwable e)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ClassProxyFactory

          public ClassProxyFactory()

  - ### Method Detail

    - #### isCallerMockInvocationHandlerInvoke

          public static boolean isCallerMockInvocationHandlerInvoke(Throwable e)
                                                             throws Throwable

      Throws:
        `Throwable`

    - #### createProxy

          public <T> T createProxy(Class<T> toMock,
                          InvocationHandler handler,
                          Method[] mockedMethods,
                          ConstructorArgs args)

      Specified by:
        `createProxy` in interface `IProxyFactory`
      Parameters:
        `toMock` - the class to mock by the factory
        `handler` - the handler that will be linked to the created proxy
        `mockedMethods` - the subset of `toMock`'s methods to mock, or null to mock all methods.
        `args` - the constructor arguments to use, or null to use heuristics to choose a constructor.
      Returns:
        the newly created proxy

    - #### getInvocationHandler

          public InvocationHandler getInvocationHandler(Object mock)

      Description copied from interface: `IProxyFactory`
      Returns the invocation handler for `mock`;
      Specified by:
        `getInvocationHandler` in interface `IProxyFactory`
      Parameters:
        `mock` - a mock instance previously returned by `createProxy`.
      Returns:
        the handler handling method calls for the `mock`

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