It's possible to restrict an Java annotation to fields, methods, etc.
But, how about a field or a method name or type?
For, example, I would like to create an annotation that can be put only in fields of the type long and with name id;
It possible using an Annotation Processor.
Some tutorials that may help in this task:
http://deors.wordpress.com/2011/10/08/annotation-processors/
http://java.dzone.com/news/using-java-6-processors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With