/// <summary> /// Gets the return type of a method. /// </summary> /// <param name="module">The module.</param> /// <param name="descriptor">The java type descriptor.</param> /// <returns>The return type of the java descriptor.</returns> public static TypeReference GetReturnType(this ModuleDefinition module, string descriptor) { Guard.NotNull(ref module, nameof(module)); Guard.NotNull(ref descriptor, nameof(descriptor)); return(module.GetDescriptorType(DescriptorHelper.GetReturn(descriptor))); }
/// <summary> /// Gets the parameter types of a method. /// </summary> /// <param name="module">The module.</param> /// <param name="descriptor">The java type descriptor.</param> /// <returns>The parameter types of the java descriptor.</returns> public static TypeReference[] GetParameterTypes(this ModuleDefinition module, string descriptor) { Guard.NotNull(ref module, nameof(module)); Guard.NotNull(ref descriptor, nameof(descriptor)); string[] parameters = DescriptorHelper.GetParameters(descriptor); return(parameters.Select(x => module.GetDescriptorType(x)).ToArray()); }
/// <summary> /// Gets the return type of a method. /// </summary> /// <param name="jm">The java method.</param> /// <param name="jc">The java class.</param> /// <returns>The return type of the java method.</returns> public static string GetReturnType(this JavaMethod jm, JavaClass jc) { Guard.NotNull(ref jc, nameof(jc)); Guard.NotNull(ref jm, nameof(jm)); string descriptor = jm.GetDescriptor(jc); return(DescriptorHelper.GetReturn(descriptor)); }