[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] pointcut to match inherited methods
|
- From: Mohan Radhakrishnan <radhakrishnan.mohan@xxxxxxxxx>
- Date: Thu, 29 Apr 2010 17:39:53 +0530
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=xQ5UBuCglaqq5DA1sDm/4/lRpsyzR9ed2+8iQxyRd0Q=; b=dC7jkwitN8Gi0vVa9RlRl4953FY3naFYi+QdBECLcC25evcMYEL8qdETxtzC+D3MXU HFlZkNerJrqt9l20V+MnYe+LOBncrqqHq3IA/3TQJ7fMPSRwX5Bq8mH08tV9md4ck+Im FVwSEVib5qHqc/vnlHtFOJkXQOyeNZzIg+aa0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=hLyjOnrEA9TW5uNuDG7V84ej8C1UI8TvLZvbvbCcFK2sdmlPcPDJER3/oaW9eTNtoo BerW4RecVmqy0SExL/s4hW7jWIh/9dUlhN4r1t44qpXy+VImduUktZskdRBQi5XfNZB4 JM0EIqOVUfvhCfadKh9cjKWdifD83l2kA682I=
Hi Ashank,
Is this pointcut what you are looking for ?
pointcut p() : execution(* B.m());
public class A {
public void m(){
System.out.println( "Test A" );
}
}
public class B extends A {
public void m(){
System.out.println( "Test B" );
}
}
Thanks,
Mohan
On Thu, Apr 29, 2010 at 3:57 PM, Ashank <k_arvind_shankar@xxxxxxxxx> wrote:
>
> Hello All,
>
> I have a simple question. The same question was asked in this post but it
> seems to have gone unaddressed as far as my understanding goes.
> http://old.nabble.com/Weaving-inherited-methods-to15405848.html#a15405848
>
> Anyway, the question is, I want a pointcut to match method calls/executions
> of inherited methods in a subclass. For instance.
>
> Class A{
> public void methodA() {}
> }
>
> Class B extends A() {
> }
>
> Class C() {
> B b = new B();
> b.methodA(); // Want to catch this.
> }
>
> As mentioned, I want to match the statement ending with the comment.
> Please help me out with the pointcut. Thank you very much
>
> --
> View this message in context: http://old.nabble.com/pointcut-to-match-inherited-methods-tp28398859p28398859.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>