Tham khảo tài liệu 'java 6 platform revealed phần 10', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | CHAPTER 10 PLUGGABLE ANNOTATION PROCESSING UPDATES 191 rip If you declare your own annotations keep in mind the pattern shown here. Repeated annotations are not allowed so they must be grouped together into a single annotation. The Package The annotations found in the package are used by the capabilities added with JSR 269 for annotation processing. There are three annotations there SupportedAnnotationTypes SupportedOptions and SupportedSourceVersion. Each of these will be described later in the chapter in the Annotation Processing section. The Package The two annotations found in the package are DescriptorKey and MXBean. If you are familiar with the Java Management Extensions their usage will prove helpful. The DescriptorKey annotation is for describing annotation elements related to a field. For an attribute operation or construction you can add descriptors such that when the resulting descriptor is created you can configure its values. See the javadoc for the DescriptorKey annotation for more information about auto-conversion of annotation elements such as rules for how a primitive becomes an object. The MXBean annotation is used to explicitly tag an interface as an MXBean interface or not. If the interface name ends in MXBean it is an MXBean interface by default. If it doesn t then the interface isn t an MXBean-related interface. The @MXBean annotation allows you to tag an interface as an MXBean if it doesn t end with MXBean and allows you to reject the automatic association if you don t want it. For the positive case the following three declarations in Listing 10-5 are defined to be MXBean interfaces assuming proper imports. Listing 10-5. @MXBean Annotation Usage Default naming public interface MyMXBean @MXBean public interface MyInterface1 @MXBean true public interface MyInterface2 192 CHAPTER 10 PLUGGABLE ANNOTATION PROCESSING UPDATES For the negative cases there are .