Inter-type declarations can only have one target, but you can use a
declare parents statement.

You could do something like this
(http://www.eclipse.org/aspectj/doc/released/progguide/language-interType.html):

aspect A {
    private interface HasName {}
    declare parents: (Point || Line || Square) implements HasName;

    private String HasName.name;
    public  String HasName.getName()  { return name; }
  }


On Thu, Jun 26, 2008 at 7:36 PM, Ashish Srivastava <[EMAIL PROTECTED]> wrote:
> Hi All,
>   Is it possible to add (instrument) a method and its implementation to all 
> the classes that I compile using ajc? If I have to add a method I do 
> something like:
> public aspect TestAspect {
>  public void Test.myMethod () {
>      System.out.println ("My Method");
>  }
> }
>
> But is it possible that I can add myMethod () to all the classes not 
> necessarily just the Test?
>
> Thanks,
> -Ashish
>
>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to