Is it possible to restrict the type of field for a Java annotation?

annotations, eclipse, java, types

Solution

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

Problem

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;

Original source