MethodType.FromMethodDescriptorString(String, ClassLoader) Method

Definition

Finds or creates an instance of a method type, given the spelling of its bytecode descriptor.

[Android.Runtime.Register("fromMethodDescriptorString", "(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/invoke/MethodType;", "", ApiSince=26)]
public static Java.Lang.Invoke.MethodType? FromMethodDescriptorString (string? descriptor, Java.Lang.ClassLoader? loader);
[<Android.Runtime.Register("fromMethodDescriptorString", "(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/invoke/MethodType;", "", ApiSince=26)>]
static member FromMethodDescriptorString : string * Java.Lang.ClassLoader -> Java.Lang.Invoke.MethodType

Parameters

descriptor
String

a bytecode-level type descriptor string "(T...)T"

loader
ClassLoader

the class loader in which to look up the types

Returns

a method type matching the bytecode-level type descriptor

Attributes

Remarks

Finds or creates an instance of a method type, given the spelling of its bytecode descriptor. Convenience method for #methodType(java.lang.Class, java.lang.Class[]) methodType. Any class or interface name embedded in the descriptor string will be resolved by calling ClassLoader#loadClass(java.lang.String) on the given loader (or if it is null, on the system class loader).

Note that it is possible to encounter method types which cannot be constructed by this method, because their component types are not all reachable from a common class loader.

This method is included for the benefit of applications that must generate bytecodes that process method handles and invokedynamic.

Java documentation for java.lang.invoke.MethodType.fromMethodDescriptorString(java.lang.String, java.lang.ClassLoader).

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