[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Multiple annotations using single declare @type?
|
There are quite a few uses for named type patterns. This bug was the
original one to talk about them:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=63304
proposing a syntax like this:
declare typename: PublicFinalType: public final *;
I hadn't thought about it being used to get around the multiple annos
on declare @type though. Mind you, it is even more work to implement
that than to implement the enhancement for declare @type !
cheers,
Andy
On 29 August 2012 20:43, Matthew Adams <matthew@xxxxxxxxxxxxxxx> wrote:
> Hey, you know, I was thinking that if I could name type expressions
> like I can name pointcuts, then this wouldn't be as big a deal.
>
> Consider:
>
> declare @type : org.example.foo.Bar+ : @Goo;
> declare @type : org.example.foo.Bar+ : @Hoo;
>
> I have no idea what a good syntax might be to name type expressions.
> Perhaps a new pointcut designator like "type"? Then, you could write:
>
> pointcut thoseAnnoyingTypes() : type(org.example.foo.Bar+); /*
> admittedly not really a pointcut... */
>
> declare @type : thoseAnnoyingTypes() : @Goo;
> declare @type : thoseAnnoyingTypes() : @Hoo;
>
> I'm pretty sure named type expressions would be useful elsewhere, like
> in "declare error" & "declare warning" statements, and pointcut
> designators "handler", "within", etc:
>
> pointcut thoseAnnoyingTypes() : type(org.example.foo.Bar+);
>
> declare @type : thoseAnnoyingTypes() : @Goo, @Hoo;
>
> pointcut withinAnnoyingTypes() : within(thoseAnnoyingTypes());
>
> Thoughts?
>
> On Thu, Aug 16, 2012 at 1:08 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
>>
>> Hi Matthew,
>>
>> I guess you mean https://bugs.eclipse.org/bugs/show_bug.cgi?id=356594
>> - which you raised :)
>>
>> I just had a quick look and added a testcase but the implementation
>> isn't as trivial as I'd hoped. A lot of infrastructure is just
>> dealing with one annotation per declare anno statement.
>>
>> cheers,
>> Andy
>>
>> On 16 August 2012 07:13, Matthew Adams <matthew@xxxxxxxxxxxxxxx> wrote:
>> > Hi all,
>> >
>> > I recall this was a question a couple of years ago.
>> >
>> > Can you now use a single "declare @type" statement to introduce several
>> > annotations at once? That way, instead of:
>> >
>> > declare @type : org.example.foo.Bar+ : @Goo;
>> > declare @type : org.example.foo.Bar+ : @Hoo;
>> >
>> > you could write:
>> >
>> > declare @type : org.example.foo.Bar+ : @Goo, @Hoo;
>> >
>> > Thanks,
>> > Matthew
>> > --
>> > mailto:matthew@xxxxxxxxxxxxxxx
>> > skype:matthewadams12
>> > googletalk:matthew@xxxxxxxxxxxxxxx
>> > http://matthewadams.me
>> > http://www.linkedin.com/in/matthewadams
>> >
>> >
>> > _______________________________________________
>> > 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
>
>
>
>
> --
> mailto:matthew@xxxxxxxxxxxxxxx
> skype:matthewadams12
> googletalk:matthew@xxxxxxxxxxxxxxx
> http://matthewadams.me
> http://www.linkedin.com/in/matthewadams
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users