how to record/monitor java field assignment operation ; for example , i want to add some function before or after the assignment operation;
original code :
class Test{
public String name;
public void operation{
.... some code ...
name="stackoverflow";
.... some code ...
}
}
After changing the code :
class Test{
public String name;
public void operation{
.... some code ...
[[ my instrument code ]]
name="stackoverflow";
[[ my instrument code ]]
.... some code ...
}
}
NOTE:
I want to instrument before or after every filed assignment line ; so it can not mannually point out which line should be instrument
is it possible using JAVA DEBUG INTERFACE ?? or is there any way to reach it INStrument or Dynamic Proxy