Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Visibility of inter-type members with @DeclareMixin and @DeclareParents

Unfortunately, I've noticed that the constructor in the implementation class must always be at least as visible as the aspect type. If the aspect is public, this class will also have to be. The interface can be private, though.

On Mon, Aug 31, 2009 at 7:21 PM, Andrew Eisenberg <andrew@xxxxxxxxxxxx> wrote:
If the interface used as the introduced parent is only accessible
inside the aspect (ie- it is private), then its methods should only be
accessible from within the aspect.  So, your strategy below should
work (however, I have not tried this out myself).

2009/8/31 João Gonçalves <jocolimonada@xxxxxxxxx>:
> Using the private keyword in the factory method (for @DeclareMixin) / field
> (for @DeclareParents)?
> That is:
>     @DeclareMixin("ClassName")
>     private static IFood create FoodImplementation() {
>         return new FoodImpl();
>     }
>
> and
>     @DeclareParents(value="ClassName",defaultImpl=FoodImpl.class)
>     private IFood food;
>
>
> Thanks. Also, in the above examples, the visibility will be private, even if
> the interface/implementation class is public, right?
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top