java - In around avice, how to get the 'type parameter' of a parameter of the advised method -
With Spring AOP, I'm writing an around that the Method in the advice, I have to get the information that the first parameter, i.e. I have tried the following by doing this But the one who logged out was just a < The code is> e . How do I insist that it is @MyAnnotation . Suppose that the blocking method was declared as follows:
@My annotation public string Some method (ArrayList & lt; Integer & gt; arrList) {...} < / pre>
arrList , type
ArrayList type parameter with
Integer .
@ around ("@notation") Public Objective Advice (Proceedings JointPoint PJP) {Method method = (( MethodSignature) pjp.getSignature ()) getMethod () .; Classroom & lt ;? & Gt; [] Parameters class = method.getParameterTypes (); Logger.info (((ParamyTermetime) Parameters Class [0] .getGenericSuperclass (). GetActualTypeArguments () [0]) ...}
java.lang.Integer
@Around ("@notation (mynotation)" throws public object advice (ProdeningJointPoint PJP) thrownable (method method = (method approval) pjp. getSignature ()). [] genericParamsClass = method.getGenericParameterTypes (); Logger.info ((Parameter Type) Generic Parameters Class [0]. GetActualTypeArguments () [0]; ...}
Comments
Post a Comment