annotations - Java APT and __LINE__ -


In another post () I asked about the preprocessing of Java and Scala using a tool like M4. I need to add the __ file / __ and __ line __ capabilities (please, "do not use cases" question). Someone suggested to check Java compiler plugin ( javax.annotation.processing.Processor ).

Special comments (can be @File , @line , or @FileLine )? An example like this would be greatly appreciated.

You mentioned in a comment on your last question, which uses a JavaWab code It should be relatively easy to modify so that a single change can be run in a preprocessing phase. You will need to remove CodeLocationClassAdapter in your own upper class and have to call for each of your class files:

  string name = "com / stackoverflow / Test ".qq"; Byte [] bytes = // Reading class-by-series bytes; Classreader CR = New Class Reader (bytes); Classware cw = New Classware (CR, 0); Class Visitor CV = New Codelication Class Adapter ); Cr.accept (cv, 0); // Modify class file type output stream out = new file output stream (name); out.write (cw.toByteArray ()); out.close ();  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -