Check out Codemodel. I've used it, though not for annotations. A quick look at the Javadoc suggests that it can generate them.