Is it possible to change the value of a method argument based on some check before execution using Spring AOP
My method
public String doSomething(final String someText, final boolean doTask) {
Consultation method
public Object invoke(final MethodInvocation methodInvocation) throws Throwable { String methodName = methodInvocation.getMethod().getName(); Object[] arguments = methodInvocation.getArguments(); if (arguments.length >= 2) { if (arguments[0] instanceof String) { String content = (String) arguments[0]; if(content.equalsIgnoreCase("A")) {
Please offer me a way to set the value of the method argument, since there are no settings for the argument.
java spring spring-aop
Ashish agggarwal
source share