Categories of annotations
17 July 2008I will write about categories of annotations in this post.
Marker annotations have no variables. These are identified by name, with no additional data supplied. For example:
@SingleValueAnnotation
Single-value annotations are similar to markers, but also provide a single piece of data. You can only provide a single bit of data with these. For example:
@SingleValueAnnotation("my data")
Full annotations have multiple data members. Annotations of this type won’t look quite so much like a normal Java method:
@FullAnnotation(var1="data value 1", var2="data value 2", var3="data value 3")
Related Posts:
- Categories of annotations
- Custom annotations - default values - I
- Java Persistence API - annotations - II
- Defining annotations
- Custom annotations - default values - III
- Custom annotations - Adding a member - I
- Java Persistence API - annotations - I
- Annotating an annotation- I
- Adding public documentation - I
- Hibernate Queries - 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: Categories of annotations