CHAPTER 10 PLUGGABLE ANNOTATION PROCESSING UPDATES 187
CHAPTER 10 PLUGGABLE ANNOTATION PROCESSING UPDATES 189 At least for the early access releases of JDK 6.0, Sun has yet to add @ConstructorProperties lines to the core library classes that are typically used as JavaBeans components. So, if you use an IDE, the core classes won t act smart and show the extra information about parameter order for constructors. The java.lang Package No new annotations here. Just the original three: @Deprecated, @Override, and @SuppressWarnings. The java.lang.annotation Package This package is primarily for the library support for the annotation facility. It includes four annotations that help annotation creators document the proper usage of their annotations. These were part of JDK 5.0, and are not new to Mustang. Documented: States whether the annotation should be documented by javadoc. Inherited: States that a parent class should be queried when an annotation is not found in main class. Retention: Identifies how long the annotation is retained. The enumeration RetentionPolicy offers three possible settings: SOURCE, CLASS, and RUNTIME. A setting of SOURCE means that the annotation is only needed to compile; CLASS means that the data is stored in the class file, but isn t necessarily used by the virtual machine (VM); and RUNTIME means that the VM retains it and thus can be read if requested. Target: Identifies the program element associated with the metadata. The ElementType enumeration offers eight possible values: ANNOTATION_TYPE, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, and TYPE. The java.sql Package The four java.sql annotations were explored in Chapter 5: @AutoGeneratedKeys, @ResultColumn, @Select, and @Update. See Chapter 5 for more information on them. The javax.annotation Package Six annotations are found in the javax.annotation package. These are heavily weighted toward usage with the enterprise edition of the Java platform, but are a standard part of Java SE 6. When used, they can provide additional information to the application server.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services