JavaPeerProxy Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Base attribute class for generated proxy types that enable AOT-safe type mapping between Java and .NET types.
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false)]
public abstract class JavaPeerProxy : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false)>]
type JavaPeerProxy = class
inherit Attribute
- Inheritance
-
JavaPeerProxy
- Attributes
Remarks
Proxy attributes are generated at build time and applied to the proxy type itself (self-application pattern). The .NET runtime's GetCustomAttribute<JavaPeerProxy>() instantiates the proxy in an AOT-safe manner — no Activator.CreateInstance() needed.
Constructors
| Name | Description |
|---|---|
| JavaPeerProxy(String, Type) | |
Properties
| Name | Description |
|---|---|
| JniName |
Gets the final JNI type name of the Java class this proxy represents. |
| TargetType |
Gets the target .NET type that this proxy represents. |
Methods
| Name | Description |
|---|---|
| CreateInstance(IntPtr, JniHandleOwnership) |
Creates an instance of the target type using the JNI handle and ownership semantics. This replaces the reflection-based constructor invocation used in the legacy path. |
| GetActivationPeer(IntPtr) | |
| MarkActivationPeerReplaceable(IntPtr) | |
| SetActivationPeerReference(IJavaPeerable, IntPtr) | |
| ShouldSkipActivation(IntPtr) |
Returns |