Use the aop intercept method and modify the value of the specified parameters in the method

problem description

I use aop to intercept a series of methods with insert, such as
void insertA (string a _ line string b)
void insertB (string a _ line string c)
void insertC (string a _ line string d)
void insertD (string a _ line string e)
then judge its parameter, and if the parameter name is a, change its value to "hello world".

how should I do this? Do you have any ideas to provide.

May.08,2021

define pointcut excution matching method directly, around pointcut pointcut (execution ( package path. Method (String,String)) and args (parameter name, parameter name)


Object [] args = pjp.getArgs (); / /

in

around method

Menu