summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorJeroen Frijters <jeroen@sumatra.nl>2006-04-23 10:21:56 +0000
committerJeroen Frijters <jeroen@sumatra.nl>2006-04-23 10:21:56 +0000
commit6df2fb65a2263004f9a16b046f213423f5f7539a (patch)
tree8779939f417dad5ef241c952ac9301cd0e6c3db3 /vm
parentd10a6d0bff86db896c80716e1f1615f431995954 (diff)
downloadclasspath-6df2fb65a2263004f9a16b046f213423f5f7539a.tar.gz
2006-04-23 Jeroen Frijters <jeroen@frijters.net>
* NEWS: Added information about annotation support. * java/lang/Class.java: Implement AnnotatedElement. (equals): Reformatted to match generics branch. (getEnumConstants): Implemented. (getAnnotation, getAnnotations, getDeclaredAnnotations, isAnnotationPresent): Merged from generics branch. * vm/reference/java/lang/VMClass.java (getDeclaredAnnotations): New method.
Diffstat (limited to 'vm')
-rw-r--r--vm/reference/java/lang/VMClass.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/vm/reference/java/lang/VMClass.java b/vm/reference/java/lang/VMClass.java
index a636698c6..aae263bf3 100644
--- a/vm/reference/java/lang/VMClass.java
+++ b/vm/reference/java/lang/VMClass.java
@@ -1,5 +1,5 @@
/* VMClass.java -- VM Specific Class methods
- Copyright (C) 2003, 2004, 2005 Free Software Foundation
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,6 +37,7 @@ exception statement from your version. */
package java.lang;
+import java.lang.annotation.Annotation;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
@@ -331,6 +332,20 @@ final class VMClass
}
/**
+ * Returns all annotations directly defined by the specified class. If
+ * there are no annotations associated with this class, then a zero-length
+ * array will be returned. The returned array may be modified by the client
+ * code, but this will have no effect on the annotation content of this
+ * class, and hence no effect on the return value of this method for
+ * future callers.
+ *
+ * @param klass the class whose annotations should be returned.
+ * @return the annotations directly defined by the specified class.
+ * @since 1.5
+ */
+ static native Annotation[] getDeclaredAnnotations(Class klass);
+
+ /**
* <p>
* Returns the canonical name of the specified class, as defined by section
* 6.7 of the Java language specification. Each package, top-level class,