title: How to create custom annotation in java?
body: <p>I want to create custom annotation in java for <code>DirtyChecking</code>. Like I want to compare two string values using this annotation and after comparing it will return a <code>boolean</code> value.</p>
  
  <p>For instance: I will put <code>@DirtyCheck("newValue","oldValue")</code> over properties.</p>
  
  <p>Suppose I made an interface:</p>
  
  <pre><code> public @interface DirtyCheck {
      String newValue();
      String oldValue();
   }
  </code></pre>
  
  <p><strong>My Questions are</strong>:</p>
  
  <ol>
  <li>Where I make a class to create a method for comparison for two string values? I mean, how this annotation notifies that this method I have to call?</li>
  <li>How to retreive returning values of this method ?</li>
  </ol>