I created an Annotation type:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ClassInfo {
public
String created();
public String createdBy();
public String lastModified();
public String lastModifiedBy();
public int revision();
}
And then, I created a class that uses that Annotation:
@ClassInfo(
created = "Jan 31 2005",
createdBy = "Me",
lastModified = "Feb 9 2005",
lastModifiedBy = "You",
revision = 3
)
public class Foo {
...
}
Then, I can
test that Annotation using the following test class:
public Class test {
public static void main(String[] args) {
System.out.println(Foo.class.isAnnotationPresent(ClassInfo.class));
}
}
However, how do I retrieve the above specific info (i.e. "Jan 31 2005") from that ClassInfo implemented within Foo?