CHAPTER 10 PLUGGABLE ANNOTATION PROCESSING UPDATES 193
194 CHAPTER 10 PLUGGABLE ANNOTATION PROCESSING UPDATES ServiceMode WebEndpoint WebFault WebServiceClient WebServiceProvider WebServiceRef These annotations are part of the core Java API for XML Web Services (JAX-WS) APIs. These were also explored in Chapter 6. Annotation Processing Enough about what annotations are out there. Let s take a look at what you can do with them when writing them yourself. First, we ll take a quick look at the 5.0 way of annotation processing. Then we ll move on to the new way. J2SE 5.0 Processing The way to process annotations with J2SE 5.0 was to use a library called the Mirror API. The Mirror API contains two parts: one for the processor, in the com.sun.mirror.apt package; and the other for a series of support classes that model the language. The language modeling piece stays put for Java SE 6, while the apt pieces relocate to the javax.annotation.processing package, with a few changes. Note For information on the Mirror API, visit http://java.sun.com/j2se/1.5.0/docs/guide/ apt/mirror/overview-summary.html. It is now released under a BSD license and available at https://aptmirrorapi.dev.java.net. To learn about the language modeling piece, you ll write a short little processor that walks through the classes found in the classpath and generates a list of all methods of all classes found. This doesn t involve writing any new tags, just processing information already made available by the runtime environment. A slightly different form of this example is part of the documentation that comes with the apt tool.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services