GetJVMSignatureNoRet() public method

public GetJVMSignatureNoRet ( ) : string
return string
Esempio n. 1
0
        private static void RegisterCLRConstructor(GType type, ConstructorInfo method, bool register)
        {
            GMethod res = RegisterCLRCall(type, method);

            if (res == null)
            {
                if (config.Verbose)
                {
                    Console.WriteLine("Skip " + type + "." + method);
                }
                // skip
                return;
            }
            res.IsConstructor = true;
            if (register)
            {
                string sig = type.Name + res.GetJVMSignatureNoRet();
                if (type.AllMethods.ContainsKey(sig))
                {
                    if (config.Verbose)
                    {
                        Console.WriteLine("Skip " + type + "." + method);
                    }
                    return;
                }
                type.AllMethods.Add(sig, res);
                type.Constructors.Add(res);
            }
        }
Esempio n. 2
0
 private static string skipJVM(GMethod skip)
 {
     return skip.Name + skip.GetJVMSignatureNoRet();
 }
Esempio n. 3
0
 private static string skipJVM(GMethod skip)
 {
     return(skip.Name + skip.GetJVMSignatureNoRet());
 }
Esempio n. 4
0
        private static void RegisterCLRMethod(GType type, MethodInfo method, bool register)
        {
            object attr = HasAttribute(method, javaMethodAttribute);

            if (method.IsGenericMethod || !method.IsPublic || attr != null)
            {
                if (attr == null && config.Verbose)
                {
                    Console.WriteLine("Skip " + type + "." + method);
                }
                return;
            }
            if (method.IsSpecialName)
            {
                string name = method.Name;
                if (name.StartsWith("op_"))
                {
                    if (config.Verbose)
                    {
                        Console.WriteLine("Skip " + type + "." + method);
                    }
                    return;
                }
            }

            GMethod res = RegisterCLRCall(type, method);

            if (res == null || TestCLRType(method.ReturnType))
            {
                // skip
                if (config.Verbose)
                {
                    Console.WriteLine("Skip " + type + "." + method);
                }
                return;
            }
            if (method.IsSpecialName)
            {
                res.CLRProperty = GetProperty(type, method);
                if (res.CLRProperty == null)
                {
                    res.CLREvent = GetEvent(type, method);
                    res.IsEvent  = true;
                    if (method.Name.StartsWith("add_"))
                    {
                        res.IsCLRPropertyAdd = true;
                        res.CLRPropertyAdd   = res;
                        foreach (GMethod m in type.Methods)
                        {
                            if (m.CLRProperty == res.CLRProperty)
                            {
                                m.CLRPropertyAdd = res;
                            }
                        }
                    }
                    if (method.Name.StartsWith("remove_"))
                    {
                        res.IsCLRPropertyRemove = true;
                        res.CLRPropertyRemove   = res;
                        foreach (GMethod m in type.Methods)
                        {
                            if (m.CLRProperty == res.CLRProperty)
                            {
                                m.CLRPropertyRemove = res;
                            }
                        }
                    }
                    res.CLRName = res.CLREvent.Name;
                    res.JVMName = method.Name.Replace("_", "");
                }
                else
                {
                    res.IsProperty = true;
                    if (res.CLRProperty.CanRead && method.Name.StartsWith("get_"))
                    {
                        res.IsCLRPropertyGetter = true;
                        res.CLRPropertyGetter   = res;
                        foreach (GMethod m in type.Methods)
                        {
                            if (m.CLRProperty == res.CLRProperty)
                            {
                                m.CLRPropertyGetter = res;
                            }
                        }
                    }
                    if (res.CLRProperty.CanWrite && method.Name.StartsWith("set_"))
                    {
                        res.IsCLRPropertySetter = true;
                        res.CLRPropertySetter   = res;
                        foreach (GMethod m in type.Methods)
                        {
                            if (m.CLRProperty == res.CLRProperty)
                            {
                                m.CLRPropertySetter = res;
                            }
                        }
                    }
                    res.CLRName = res.CLRProperty.Name;
                    res.JVMName = method.Name.Replace("_", "");
                    if (res.CLRProperty.PropertyType == typeof(bool) && res.JVMName.StartsWith("getIs"))
                    {
                        res.JVMName = "is" + res.JVMName.Substring(5);
                    }
                }
                res.Name = method.Name;
            }

            if (method.DeclaringType != type.CLRType)
            {
                res.DeclaringType = RegisterType(method.DeclaringType);
            }
            res.ReturnType = RegisterType(method.ReturnType);
            if (register)
            {
                bool force = false;
                if (UseMethodModifier(type, res, res.Name, res.GetCLRSignature(), ref force))
                {
                    if (config.Verbose)
                    {
                        Console.WriteLine("Skip " + type + "." + method);
                    }
                    return;
                }
                FinishRegistration(method.Name, type, res, force, res.Name + res.GetJVMSignatureNoRet(), skipJVM);
            }
        }