private Class clazz;
private String name;
private int slot;
+
+ /**
+ * Unparsed annotations.
+ */
private byte[] annotations = null;
+
+ /**
+ * Annotations get parsed the first time they are
+ * accessed and are then cached it this map.
+ */
private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations = null;
private static final int FIELD_MODIFIERS
| Modifier.PUBLIC | Modifier.STATIC | Modifier.TRANSIENT
| Modifier.VOLATILE;
+ /**
+ * Helper array for creating a new array from a java.util.Container.
+ */
private static final Annotation[] EMPTY_ANNOTATIONS_ARRAY =
new Annotation[0];
return declaredAnnotations().values().toArray(EMPTY_ANNOTATIONS_ARRAY);
}
+ /**
+ * Parses the annotations if they aren't parsed yet and stores them into
+ * the declaredAnnotations map and return this map.
+ */
private synchronized native Map<Class<? extends Annotation>, Annotation> declaredAnnotations();
}