Custom annotations - Adding a member - II

26 July 2008

Do read the first part of this post.

In the last post, I declared a custom annotation type which defines a string named value that the annotation type can accept. The following example shows how to use an annotation type with a member value:

@com.domain.tiger.a.InProgress
@TODO("Figure out the amount of interest per month")
public void calculateInterest(float amount, float rate) {
  // Need to finish this method later
}

It is assumed that com.domain.tiger.a.InProgress has been imported which means that we don’t prefix the annotation with its package name.

del.icio.us:Custom annotations - Adding a member - II  digg:Custom annotations - Adding a member - II  spurl:Custom annotations - Adding a member - II  wists:Custom annotations - Adding a member - II  simpy:Custom annotations - Adding a member - II  newsvine:Custom annotations - Adding a member - II  blinklist:Custom annotations - Adding a member - II  furl:Custom annotations - Adding a member - II  reddit:Custom annotations - Adding a member - II  fark:Custom annotations - Adding a member - II  blogmarks:Custom annotations - Adding a member - II  Y!:Custom annotations - Adding a member - II  smarking:Custom annotations - Adding a member - II  magnolia:Custom annotations - Adding a member - II  segnalo:Custom annotations - Adding a member - II  gifttagging:Custom annotations - Adding a member - 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: Custom annotations - Adding a member - II

Leave a Reply