public class ProxyFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
useasm |
Constructor and Description |
---|
ProxyFactory() |
Modifier and Type | Method and Description |
---|---|
static java.lang.reflect.InvocationHandler |
getInvocationHandler(java.lang.Object proxy)
Get the invocation handler of a proxy.
|
static boolean |
isASMProxyClass(java.lang.Class<?> cl)
Test if it is a ASM proxy class.
|
static boolean |
isProxyClass(java.lang.Class<?> cl)
Returns true if and only if the specified class was dynamically
generated to be a proxy class using the
getProxyClass
method or the newProxyInstance method. |
static java.lang.Object |
newProxyInstance(java.lang.ClassLoader loader,
java.lang.Class<?>[] interfaces,
java.lang.reflect.InvocationHandler h)
Returns an instance of a proxy class for the specified interfaces
that dispatches method invocations to the specified invocation
handler.
|
public static java.lang.Object newProxyInstance(java.lang.ClassLoader loader, java.lang.Class<?>[] interfaces, java.lang.reflect.InvocationHandler h)
public static java.lang.reflect.InvocationHandler getInvocationHandler(java.lang.Object proxy) throws java.lang.IllegalArgumentException
proxy
- java.lang.IllegalArgumentException
public static boolean isProxyClass(java.lang.Class<?> cl)
getProxyClass
method or the newProxyInstance
method.
Proxy.
cl
- the class to testtrue
if the class is a proxy class and
false
otherwisejava.lang.NullPointerException
- if cl
is null
public static boolean isASMProxyClass(java.lang.Class<?> cl)
cl
- The class.