How do you use Java 1.6 Annotation Processing to perform compile time weaving?

前端 未结 4 1589
滥情空心
滥情空心 2020-12-18 02:57

I have created an annotation, applied it to a DTO and written a Java 1.6 style annotationProcessor. I can see how to have the annotationProcessor write a new source file, w

4条回答
  •  盖世英雄少女心
    2020-12-18 03:48

    You have to extend the javac compiler for this, which means building your program won't be as portable as a regular application. See http://weblogs.java.net/blog/cayhorstmann/archive/2006/06/say_no_to_prope.html for more details on how someone achieved this.

提交回复
热议问题