Automatically remove the file generated by Java 7 Annotation Processor when delete the annotation in source file -


i writing java annotation processor java 7 source code. , surely, can use javax.annotation.processing.filer me generate file under project directory automatically.

ex: annotation @becare

public interface test {    @becare    int compare(int a, int b); } 

my annotation processor's job when detects given annotation @becare, generate file me.

my question if remove annotation previous code snippet, can let annotation processor aware , delete file created?

or there workaround me achieve ?

thanks in advance.

when create genrated file declare it's linked 'test' interface this:

elements eltutils = processingenv.getelementutils(); filer.createsourcefile("testgenerated", eltutils.gettypeelement("test"));

when source deleted, processor remove generated file javadoc says:

if there no originating elements, none need passed. information may used in incremental environment determine need rerun processors or remove generated files. non-incremental environments may ignore originating element information.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -