Inheritance: global::java.lang.reflect.AccessibleObject, global::java.lang.reflect.Member
Exemplo n.º 1
0
    public static long objectFieldOffset(MemberName self)
    {
#if FIRST_PASS
        return(0);
#else
        JlReflect.Field field = (JlReflect.Field)TypeWrapper.FromClass(self.getDeclaringClass())
                                .GetFieldWrapper(self.getName(), self.getSignature().Replace('/', '.')).ToField(false);
        return(sun.misc.Unsafe.allocateUnsafeFieldId(field));
#endif
    }
Exemplo n.º 2
0
    public static java.lang.reflect.Field copyFieldAndMakeAccessible(java.lang.reflect.Field field)
    {
#if FIRST_PASS
        return(null);
#else
        field           = new java.lang.reflect.Field(field.getDeclaringClass(), field.getName(), field.getType(), field.getModifiers() & ~java.lang.reflect.Modifier.FINAL, field._slot(), null, null);
        field.@override = true;
        return(field);
#endif
    }
Exemplo n.º 3
0
    public static java.lang.reflect.Field createFieldAndMakeAccessible(java.lang.Class c, string fieldName)
    {
#if FIRST_PASS
        return(null);
#else
        // we pass in ReflectAccess.class as the field type (which isn't used)
        // to make Field.toString() return something "meaningful" instead of crash
        java.lang.reflect.Field field = new java.lang.reflect.Field(c, fieldName, [email protected] <java.lang.reflect.ReflectAccess> .Value, 0, -1, null, null);
        field.@override = true;
        return(field);
#endif
    }
Exemplo n.º 4
0
 private static FieldWrapper GetFieldWrapper(java.io.ObjectStreamField field)
 {
     java.lang.reflect.Field f = field.getField();
     return(f == null ? null : FieldWrapper.FromField(f));
 }
 FieldExpression(Field field, Expression target)
     : super(ExpressionKind.Field, field.getType()) {
Exemplo n.º 6
0
    public static object getDeclaredAnnotationsImpl(java.lang.reflect.Field thisField)
    {
        FieldWrapper fw = FieldWrapper.FromField(thisField);

        return(Java_java_lang_Class.AnnotationsToMap(fw.DeclaringType.GetClassLoader(), fw.DeclaringType.GetFieldAnnotations(fw)));
    }
Exemplo n.º 7
0
 internal FrameworkField([In] Field obj0)
 {
   FrameworkField frameworkField = this;
   this.fField = obj0;
 }
Exemplo n.º 8
0
    public static byte[] getTypeAnnotationBytes0(java.lang.reflect.Field thisField)
    {
        FieldWrapper fw = FieldWrapper.FromField(thisField);

        return(fw.DeclaringType.GetFieldRawTypeAnnotations(fw));
    }
Exemplo n.º 9
0
 private static void RegisterJVMField(GType type, Field field, bool register)
 {
     var modifiers = (ModifierFlags) field.getModifiers();
     if ((modifiers & (ModifierFlags.Private | ModifierFlags.Synthetic)) != ModifierFlags.None)
     {
         if (config.Verbose)
         {
             Console.WriteLine("Skip " + type + "." + field);
         }
         return;
     }
     var res = new GMethod();
     res.Type = type;
     res.IsField = true;
     res.Name = field.getName();
     res.JVMName = field.getName();
     res.CLRName = res.JVMName;
     res.IsJVMMethod = true;
     ConvertJVMAttributes(type, res, field);
     res.ReturnType = RegisterClass(field.getType());
     res.LowerName = (field.getName());
     if (register)
     {
         type.Methods.Add(res);
         type.MethodsWithInterfaces.Add(res);
     }
 }