Custom annotations - Adding a member - II
26 July 2008Do 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.
Related Posts:
- Custom annotations - Adding a member - I
- Custom annotations - default values - I
- Custom annotations - default values - II
- Custom annotations - default values - III
- Adding public documentation - I
- Annotating an annotation- I
- Categories of annotations
- Categories of annotations
- Defining own annotation type - II
- Setting up inheritance - I
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