title: How to use java annotations to modify source code before final compilation?
body: <p>I've read from the apt tool page that one can create AnnotationProcessors to <a href="http://download.oracle.com/javase/1.5.0/docs/guide/apt/GettingStarted.html" rel="noreferrer">generate new derived files (source files, class files, deployment descriptors, etc.)</a>. I am looking for example to do so.</p>
  
  <p>My need is to encode all annotated strings at compile time, so that reading the class file does not allow reading the static strings:</p>
  
  <p>Base code:</p>
  
  <pre><code>String message = (@Obfuscated "a string that should not be readable in class file");
  </code></pre>
  
  <p>Should be reworked as:</p>
  
  <pre><code>String message = new ObfuscatedString(new long[] {0x86DD4DBB5166C13DL, 0x4C79B1CDC313AE09L, 0x1A353051DAF6463BL}).toString();
  </code></pre>
  
  <p>Based on the static <a href="http://java.net/projects/truelicense" rel="noreferrer"><code>ObfuscatedString.obfuscate(String)</code> method of the TrueLicense framework</a>, the processor can generate the code to replace the annotated string. Indeed, this method generates the string "new ObfuscatedString([numeric_code]).toString()".
  At runtime the toString() method of ObfuscatedString is able to return the string encoded in the numeric code.</p>
  
  <p>Any idea on how to write the process() method of the AnnotationProcessor to edit the annotated code?</p>
  
  <p>Thanks in advance,</p>