43 import sun.reflect.annotation.TypeAnnotationParser;
44
45 /**
46 * A {@code Field} provides information about, and dynamic access to, a
47 * single field of a class or an interface. The reflected field may
48 * be a class (static) field or an instance field.
49 *
50 * <p>A {@code Field} permits widening conversions to occur during a get or
51 * set access operation, but throws an {@code IllegalArgumentException} if a
52 * narrowing conversion would occur.
53 *
54 * @see Member
55 * @see java.lang.Class
56 * @see java.lang.Class#getFields()
57 * @see java.lang.Class#getField(String)
58 * @see java.lang.Class#getDeclaredFields()
59 * @see java.lang.Class#getDeclaredField(String)
60 *
61 * @author Kenneth Russell
62 * @author Nakul Saraiya
63 */
64 public final
65 class Field extends AccessibleObject implements Member {
66
67 private Class<?> clazz;
68 private int slot;
69 // This is guaranteed to be interned by the VM in the 1.4
70 // reflection implementation
71 private String name;
72 private Class<?> type;
73 private int modifiers;
74 // Generics and annotations support
75 private transient String signature;
76 // generic info repository; lazily initialized
77 private transient FieldRepository genericInfo;
78 private byte[] annotations;
79 // Cached field accessor created without override
80 private FieldAccessor fieldAccessor;
81 // Cached field accessor created with override
82 private FieldAccessor overrideFieldAccessor;
|
43 import sun.reflect.annotation.TypeAnnotationParser;
44
45 /**
46 * A {@code Field} provides information about, and dynamic access to, a
47 * single field of a class or an interface. The reflected field may
48 * be a class (static) field or an instance field.
49 *
50 * <p>A {@code Field} permits widening conversions to occur during a get or
51 * set access operation, but throws an {@code IllegalArgumentException} if a
52 * narrowing conversion would occur.
53 *
54 * @see Member
55 * @see java.lang.Class
56 * @see java.lang.Class#getFields()
57 * @see java.lang.Class#getField(String)
58 * @see java.lang.Class#getDeclaredFields()
59 * @see java.lang.Class#getDeclaredField(String)
60 *
61 * @author Kenneth Russell
62 * @author Nakul Saraiya
63 * @since 1.1
64 */
65 public final
66 class Field extends AccessibleObject implements Member {
67
68 private Class<?> clazz;
69 private int slot;
70 // This is guaranteed to be interned by the VM in the 1.4
71 // reflection implementation
72 private String name;
73 private Class<?> type;
74 private int modifiers;
75 // Generics and annotations support
76 private transient String signature;
77 // generic info repository; lazily initialized
78 private transient FieldRepository genericInfo;
79 private byte[] annotations;
80 // Cached field accessor created without override
81 private FieldAccessor fieldAccessor;
82 // Cached field accessor created with override
83 private FieldAccessor overrideFieldAccessor;
|