When using spring aop:around, how can I get return type of the pointcut method?

后端 未结 1 2070
陌清茗
陌清茗 2021-02-20 10:32

I have a requirement now, that is when using mybatis(especially those batch execute sql), check parameter first , if the parameter is null or empty , then just return, don\'t pr

相关标签:
1条回答
  • 2021-02-20 11:03

    To get method return type/class from a ProceedingJoinPoint you can do this:

    Signature signature =  proceedingJoinPoint.getSignature();
    Class returnType = ((MethodSignature) signature).getReturnType();
    
    0 讨论(0)
提交回复
热议问题