Annotating an annotation- II

26 July 2008

This post is continued form the last one. Do read that one first.

I will now present an example that shows the ElementType enum :

package java.lang.annotation;
 
public enum ElementType {
  TYPE,			// Class, interface, or enum (but not annotation)
  FIELD,		// Field (including enumerated values)
  METHOD,		// Method (does not include constructors)
  PARAMETER,		// Method parameter
  CONSTRUCTOR,		// Constructor
  LOCAL_VARIABLE,	// Local variable or catch clause
  ANNOTATION_TYPE,	// Annotation Types (meta-annotations)
  PACKAGE		// Java package
}

The enumerated values in exampel above are obvious. When you use the Target meta-annotation, you supply it at least one of these enumerated values and indicate
which program elements the annotated annotation can target.

Continued …

del.icio.us:Annotating an annotation- II  digg:Annotating an annotation- II  spurl:Annotating an annotation- II  wists:Annotating an annotation- II  simpy:Annotating an annotation- II  newsvine:Annotating an annotation- II  blinklist:Annotating an annotation- II  furl:Annotating an annotation- II  reddit:Annotating an annotation- II  fark:Annotating an annotation- II  blogmarks:Annotating an annotation- II  Y!:Annotating an annotation- II  smarking:Annotating an annotation- II  magnolia:Annotating an annotation- II  segnalo:Annotating an annotation- II  gifttagging:Annotating an annotation- II

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Annotating an annotation- II

Leave a Reply