25using IKVM.ByteCode.Decoding;
30 sealed partial class ClassFile
36 internal sealed class ConstantPoolItemMethodType : ConstantPoolItem
39 readonly Utf8ConstantHandle signature;
42 RuntimeJavaType[] argTypeWrappers;
43 RuntimeJavaType retTypeWrapper;
50 public ConstantPoolItemMethodType(RuntimeContext context, MethodTypeConstantData data) :
53 signature = data.Descriptor;
57 public override ConstantType GetConstantType() => ConstantType.MethodType;
62 var descriptor = classFile.GetConstantPoolUtf8String(utf8_cp, signature);
66 this.descriptor =
string.Intern(descriptor.Replace(
'/',
'.'));
70 public override void Link(RuntimeJavaType thisType,
LoadMode mode)
73 if (argTypeWrappers != null)
76 var classLoader = thisType.ClassLoader;
77 var args = classLoader.ArgJavaTypeListFromSig(descriptor, mode);
78 var ret = classLoader.RetTypeWrapperFromSig(descriptor, mode);
82 if (argTypeWrappers ==
null)
84 argTypeWrappers = args;
90 public string Signature => descriptor;
92 public RuntimeJavaType[] GetArgTypes() => argTypeWrappers;
94 public RuntimeJavaType GetRetType() => retTypeWrapper;
static bool IsValidMethodDescriptor(string descriptor)
Returns true if the specified descriptor is a valid method descriptor.