Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Can I use "Declare Parents" to make an interface be the parent of another interface?

What I wanted to know was if declaring an implementation for an interface, automatically declared the implementation for the implementing classes. But the answer is no.
I've filed an enhancement request (as suggested by other users): https://bugs.eclipse.org/bugs/show_bug.cgi?id=288713
Thanks.

On Thu, Sep 3, 2009 at 5:40 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
Does this do what you want?


interface A { }

interface B { void foo();}

class BImpl implements B { public void foo() {System.out.println("foo
running");}}

@Aspect
class X {

       @DeclareMixin("C")
       public static B createB() {
               return new BImpl();
       }

       public static void main(String[] args) {
               ((B)new C()).foo();
       }
}

class C implements A { }


2009/9/1 João Gonçalves <jocolimonada@xxxxxxxxx>:
> Greetings.
>
> Can I use @DeclareParents this way:
>
>
> interface A { }
>
> interface B { }
>
> @DeclareParents(value="B", defaultImpl=BImpl.class)
> private A something;
>
> class C implements A { }
>
>
>
>
> Will class C have the methods declared in B?
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top