* src/lib/gnu/java/lang/reflect/Method.java
[cacao.git] / src / native / vm / gnu / java_lang_reflect_Field.c
index af9fb08d89c11ac3aa0dd040051b6aa1a81182f8..61de92d25b498b2eafbe663bb713c056ea7ece34 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Field.c 8132 2007-06-22 11:15:47Z twisti $
+   $Id: java_lang_reflect_Field.c 8262 2007-08-06 12:44:01Z panzi $
 
 */
 
 
 #include "native/include/java_lang_reflect_Field.h"
 
+#if defined(ENABLE_ANNOTATIONS)
+#include "native/include/sun_reflect_ConstantPool.h"
+#include "native/vm/reflect.h"
+#endif
+
 #include "vm/access.h"
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
@@ -88,6 +93,9 @@ static JNINativeMethod methods[] = {
        { "setFloat",             "(Ljava/lang/Object;F)V",                  (void *) (intptr_t) &Java_java_lang_reflect_Field_setFloat             },
        { "setDouble",            "(Ljava/lang/Object;D)V",                  (void *) (intptr_t) &Java_java_lang_reflect_Field_setDouble            },
        { "getSignature",         "()Ljava/lang/String;",                    (void *) (intptr_t) &Java_java_lang_reflect_Field_getSignature         },
+#if defined(ENABLE_ANNOTATIONS)
+       { "declaredAnnotations",  "()Ljava/util/Map;",                       (void *) (intptr_t) &Java_java_lang_reflect_Field_declaredAnnotations  },
+#endif
 };
 
 
@@ -1263,6 +1271,26 @@ JNIEXPORT java_lang_String* JNICALL Java_java_lang_reflect_Field_getSignature(JN
 }
 
 
+#if defined(ENABLE_ANNOTATIONS)
+/*
+ * Class:     java/lang/reflect/Field
+ * Method:    declaredAnnotations
+ * Signature: ()Ljava/util/Map;
+ */
+JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Field_declaredAnnotations(JNIEnv *env, struct java_lang_reflect_Field* this)
+{
+       java_objectheader *o = (java_objectheader*)this;
+
+       if (this == NULL) {
+               exceptions_throw_nullpointerexception();
+               return NULL;
+       }
+
+       return reflect_get_declaredannotatios(&(this->declaredAnnotations), this->annotations, this->clazz, o->vftbl->class);
+}
+#endif
+
+
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where