java - pointcut for inherited methods -
How can I match all the available methods for a particular class?
For example,
A / | \ BCD / | \ EF I T I need to match all the methods available in the T , so these methods are the methods defined in T and they are inherited Methods found in the classes from a , c , f . I came to the following points, but was not very happy with it as it T : execution (* A +. *. ..) & amp; As I understand, the elements identified from such a point are a , b , c , D , e , F , I , T . I do not want to affect sections outside the family. This would be ideal if only T is affected (legacy method can be identified with the code overridden. ) There are many classes and I want to reduce the effect on the rest of the system, that is, I only need to change the behavior of class T and these changes do not want to affect other classes. I can point to the following: (execution (* a * (..)) execution (* c (..)) ... ... & lt ; All guardian classes & gt;); & Amp; This (t) . But it makes me sure that the hierarchy is correct and whenever the real hierarchy changes, then update it. Thank you.
Your assumption is wrong, I just tried and checked the byte code. The advice will only be worn in A, C, F, T because this () can be determined statically during the compiled time. Update: I forgot to mention that your point only corresponds to the methods derived from A and its subclasses. If you, as you say in the title, actually If you want to match all legacy methods, use execution (* * (..) and & amp; amp; it (t) .
Comments
Post a Comment