Why don't you write a custom Java Annotation Processor. You just have to implement one single class extending AbstractProcessor
. There are several tutorials out there how to write an annotation processor. You just list via @SupportedAnnotationTypes
which annotations you are interested in and you get callbacks for each occurrence of these annotations. You can then build up your header file and print it out when processing it done.
If the annotation processor is on your classpath at compile time it will automatically run or you can use the maven-processor-plugin to configure annotation processing explicitly.