Reputation: 2101
I have
@ColumnMetadata(index=1)
...
@ColumnMetadata(index=2)
...
@ColumnMetadata(index=3)
...
And I have to check whether index numbers are unique using APT. I have no idea how to do this. I don't understand tutorials, generally I have problem to find materials on the net.
How to do this? Any tutorials/anything about APT?
Upvotes: 4
Views: 441
Reputation: 29949
You probably want to use the pluggable annotation API, the successor of the apt tool. Here's a short tutorial to get started: Java 6.0 Features Part – 2 : Pluggable Annotation Processing API
This are roughly the steps you need to do to check your annotations:
@SupportedAnnotationTypes(value= {"full.name.of.ColumnMetadata"})
process
method.Upvotes: 8