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?

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
>
>


Back to the top