Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sun has provided new java.lang APIs for strongly-typed access to JSR175 annotation values. However, this can only be used to access annotations which have a 'runtime retention policy;' annotations without this must be accessed via javadoc, which provides a completely different, untyped API for viewing annotations. Mediating between these two access models could be a problem for frameworks, particularly those which must access source artifacts not available via reflection, such as javadoc comments.

...

What does Annogen do

...

?

Annogen uses your JSR175 annotation types to code-generate special java beans called AnnoBeans. AnnoBeans look exactly like your JSR175 annotations; in fact, they can actually directly implement your JSR175 annotation interfaces. AnnoBeans carry exactly the same data that appears on your JSR175 annotations. You write your framework code to use AnnoBeans when it needs to understand what annotations are on a java class.

...

Why is that useful?

Overrides

One big advantage to this approach stems from the fact that AnnoBeans can be modified. AnnoBeans start out reflecting the values on the actual annotations they represent. You are then given the option to add, modify, or remove annotation values before they are consumed by your framework.

...