I want to create custom annotation in java for DirtyChecking. Like I want to compare two string values using this annotation and after comparing it will return a boolean value.

For instance: I will put @DirtyCheck("newValue","oldValue") over properties.

Suppose I made an interface:

 public @interface DirtyCheck {
    String newValue();
    String oldValue();
 }

My Questions are:

  1. 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?
  2. How to retreive returning values of this method ?
Edit
Report