Retrieving custom annotations reflectively

Hi,

I apologize in advance if this is common knowledge but I'm new to annotations and don't really have enough time to figure it out myself.

I'm trying to reflectively access the annotations in certain classes in my code. This works great for all kinds of annotations except the ones that I define. (part of the same code base). Any ideas why this is the case?

Any help is greatly appreciated.

[422 byte] By [RGGSa] at [2007-11-27 4:44:19]
# 1

put @Retention(RetentionPolicy.RUNTIME)

on your annotation type declaration.

eg

@Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation{}

Read the javadoc to find out why.

Bruce

brucechapmana at 2007-7-12 9:56:18 > top of Java-index,Core,Core APIs...