Пример #1
0
            public Signature(MethodDefinition method, ExportFieldAttribute exportField)
                : this(method.Name, GetJniSignature(method), "__export__", null, null, null)
            {
                if (method.HasParameters)
                {
                    Diagnostic.Error(4205, JavaCallableWrapperGenerator.LookupSource(method), "[ExportField] can only be used on methods with 0 parameters.");
                }
                if (method.ReturnType.MetadataType == MetadataType.Void)
                {
                    Diagnostic.Error(4208, JavaCallableWrapperGenerator.LookupSource(method), "[ExportField] cannot be used on a method returning void.");
                }
                IsExport   = true;
                IsStatic   = method.IsStatic;
                JavaAccess = JavaCallableWrapperGenerator.GetJavaAccess(method.Attributes & MethodAttributes.MemberAccessMask);

                // annotations are processed within JavaFieldInfo, not the initializer method. So we don't generate them here.
            }
Пример #2
0
            public Signature(MethodDefinition method, ExportFieldAttribute exportField, IMetadataResolver cache)
                : this(method.Name, GetJniSignature(method, cache), "__export__", null, null, null)
            {
                if (method.HasParameters)
                {
                    Diagnostic.Error(4205, JavaCallableWrapperGenerator.LookupSource(method), Localization.Resources.JavaCallableWrappers_XA4205);
                }
                if (method.ReturnType.MetadataType == MetadataType.Void)
                {
                    Diagnostic.Error(4208, JavaCallableWrapperGenerator.LookupSource(method), Localization.Resources.JavaCallableWrappers_XA4208);
                }
                IsExport   = true;
                IsStatic   = method.IsStatic;
                JavaAccess = JavaCallableWrapperGenerator.GetJavaAccess(method.Attributes & MethodAttributes.MemberAccessMask);

                // annotations are processed within JavaFieldInfo, not the initializer method. So we don't generate them here.
            }