Hi,
I am relatively new to annotations and wanted to create a sample annotation just to experiment a little with them. At the moment I already managed to create simple annotation and determine on which field this annotation resided. However I would like to know if it is possible to change a field value from annotations and also whether the way I am doing it is correct. For example, imagine the following code;
public class MyClass{
@ChangeTheFollowing
private MySecondClass secondClass = new MySecondClass();
}
Now at the moment I am creating a third class which loops through all the fields the MyClass instance and then stops at the field where the annotation is found. I was then going to use Reflection to change a value in MySecondClass instance. However I was wondering if there is any other way how to do this from the Annotation class itself (i.e. - from ChangeTheFollowing) rather then having to have a third class to process the annotations.
Regards,
Sim085