seems that only compiling classes which use my own annotations will trigger my annotation processor, is there any way to trigger my annotation processor like @Deprecated does? that is when using something which has been annotated will trigger my annotation processor?

i found that in java 6 annotation processor SDK, you can define your processor to apply to all annotation types (@SupportedAnnotationTypes('*')), then even compiling a class file with no annotation used, your processor will be triggered.

however, seems we still can't get information we need through javax.lang.model.element.

efinal wrote:
i found that in java 6 annotation processor SDK, you can define your processor to apply to all annotation types (@SupportedAnnotationTypes('*')), then even compiling a class file with no annotation used, your processor will be triggered.

* Correct; supporting "*" will claim all annotations, even an empty set.

Your processor can also support "java.lang.Deprecated" too.

however, seems we still can't get information we need through javax.lang.model.element.