| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public <T> T | createProxy(Class<T>
the class to mock by the factory toMock, InvocationHandler the handler that will be linked to the created proxy handler, Method[] the subset of mockedMethods, ConstructorArgs toMock's methods to mock, or
null to mock all methods.the constructor arguments to use, or null to use
heuristics to choose a constructor. constructorArgs)Implements org. |
| public InvocationHandler | getInvocationHandler(Object
a mock instance previously returned by mock)createProxy.Implements org. mock;
|
| AndroidClassProxyFactory | back to summary |
|---|---|
| public AndroidClassProxyFactory() | |
| createProxy | back to summary |
|---|---|
| public <T> T createProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs constructorArgs) Implements org.
| |
| getInvocationHandler | back to summary |
|---|---|
| public InvocationHandler getInvocationHandler(Object mock) Implements org. Doc from org. Returns the invocation handler for
| |
| Modifier and Type | Field and Description |
|---|---|
| private final InvocationHandler | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(Object
the proxy instance that the method was invoked on obj, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. |
| private boolean |
| delegate | back to summary |
|---|---|
| private final InvocationHandler delegate | |
| mockedMethods | back to summary |
|---|---|
| private final Set<Method> mockedMethods | |
| MockHandler | back to summary |
|---|---|
| public MockHandler(InvocationHandler delegate, Method... mockedMethods) | |
| invoke | back to summary |
|---|---|
| public Object invoke(Object obj, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| isMocked | back to summary |
|---|---|
| private boolean isMocked(Method method) | |