public @interface MyAnnotation {
String value() default "";
int count() default 0;
}
public class MyAnnotationProcessor extends AbstractProcessor {
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
for (Element element : roundEnv.getElementsAnnotatedWith(MyAnnotation.class)) {
// ...
}
return true;
}
}
META-INF/services/javax.annotation.processing.Processor
com.example.MyAnnotationProcessor