Java Annotations
I presented a talk on Java Annotations to the Columbia, Maryland Java Users Group on 1/19/2010. This page contains links to a video recording of the talk and the source code that I wrote during the talk.
I hope you find it informative, entertaining and useful!
Note: I'm adding more videos as I get time. Subscribe to my
RSS
feed to be notified.
Videos
I've uploaded the following videos to vimeo. Each is listed below with a short description. I recommend you watch them in order as they assume knowledge of previous videos.
Video License

Java Annotations by
Scott Stanchfield is licensed under a
Creative Commons Attribution-Noncommercial-No Derivative Works
3.0 United States License.
Feel free to watch the videos and point friends to them, but you
cannot use them as part of any commercial product nor can you
create derivative works. Follow the link above to see the
complete license text.
- Part 1 - Introduction -
http://vimeo.com/8875862
Introduction to Java Annotations (what they are and why you would use them).
- Part 2 - Classfile Annotations -
http://vimeo.com/8875891
Creating annotations that are kept in the generated class files but not loaded in the VM at runtime.
- Part 3 - Runtime Annotations 1 -
http://vimeo.com/8875911
Example of annotating methods with a custom @Test annotation to run in a test runner similar to junit.
- Part 4 - Runtime Annotations 2 -
http://vimeo.com/8875933
Example of annotating methods to be used as actions that are triggered from buttons in a user interface.
- Part 5 - Code Generation 1 -
http://vimeo.com/8876665
Writing an annotation processor that runs at compile time to generate an RMI interface from a standard interface.
- Part 6 - Code Generation 2 -
http://vimeo.com/8876702
Using an annotation processor to generate JavaBean boilerplate code.
Sample Code
Here is the sample code I wrote during the lecture. Note that this code is not intended for production use.
Software License
All sample code is licensed under the Eclipse Public License, version 1.0.
See http://www.eclipse.org/legal/epl-v10.html for details.