advertisement

Generated source annotation

In my last 2 projects i generated some source code with jaxb. I used the maven plugin for jaxb and the source code was generated under src/main/generated-sources. This all worked quite well till i started to use some quality assurence plugins within maven. To exclude the generated sources i had to do quite some configuration and this got me thinking about why there is no annotation in java to indicate that a class or even method is generated.

The benefits of such an annotation would first off all be that all those quality check tools like checkstyle, pmd, findbugs etc and code coverage tools could easily be configured to exclude all generated sources, but if the annotation is available at runtime it could solve a lot of other problems that often occur with generated-source code. For example if the annotation had some properties like generation-tool-name, generation-tool-version etc it would be quite easy to detect version mismatches at runtime. In fact it would be quite easy to build a framework to offer this kind of functionality.

  • Share/Bookmark

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>