I realise that this might be a question that has been asked and answered, but please bear with me.
I want to know if it is possible to use annotations to inject code int
I went looking for something similar last year. There is no standard way to alter classes using annotation processors or the compiler and the annotation API documentation recommends creating decorators.
If you are willing to live with the hacks, have a look at Adrian Kuhn's use of the private API where he adds Roman numeral literals to Java. This approach is limited to the Sun javac compiler and you would need to implement something else if you used another (like the Eclipse compiler).
Edit: anyone interested in this area should check out Project Lombok.