Udostępnij za pośrednictwem


Proxy.NewProxyInstance(ClassLoader, Class[], IInvocationHandler) Method

Definition

Returns an instance of a proxy class for the specified interfaces that dispatches method invocations to the specified invocation handler.

[Android.Runtime.Register("newProxyInstance", "(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;", "")]
public static Java.Lang.Object NewProxyInstance (Java.Lang.ClassLoader? loader, Java.Lang.Class[] interfaces, Java.Lang.Reflect.IInvocationHandler h);
[<Android.Runtime.Register("newProxyInstance", "(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;", "")>]
static member NewProxyInstance : Java.Lang.ClassLoader * Java.Lang.Class[] * Java.Lang.Reflect.IInvocationHandler -> Java.Lang.Object

Parameters

loader
ClassLoader

the class loader to define the proxy class

interfaces
Class[]

the list of interfaces for the proxy class to implement

h
IInvocationHandler

the invocation handler to dispatch method invocations to

Returns

a proxy instance with the specified invocation handler of a proxy class that is defined by the specified class loader and that implements the specified interfaces

Attributes

Remarks

Returns an instance of a proxy class for the specified interfaces that dispatches method invocations to the specified invocation handler.

Proxy.newProxyInstance throws IllegalArgumentException for the same reasons that Proxy.getProxyClass does.

Java documentation for java.lang.reflect.Proxy.newProxyInstance(java.lang.ClassLoader, java.lang.Class<?>[], java.lang.reflect.InvocationHandler).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to