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:
- 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?
- How to retreive returning values of this method ?