[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Type expression matching annotation values: String matching, numeric ranges, etc?
|
Jumping in to this discussion, feel free to kick me out... :)
Seems like there are two overall strategies here: (a) ad hoc syntax and (b) generic java _expression_ syntax.
Option (a) is what Matthew is suggesting... takes a lot more work, gives more flexibility. And the answer to the "member of array" question just falls out if you choose option (a), e.g.
@Foo(Arrays.asList(value).contains(1)).
If you choose option (b) then not only do we have to invent a bunch of new, custom syntax, there will be an endless round of bike-shed arguments about what that syntax ought to be. But (b) is probably a lot more expedient (especially if the project maintainers just dictate whatever syntax they care to implement :)
So I think the first question that should be answered before getting into all the details is: (a) or (b) ?
-Archie
On Fri, Apr 26, 2013 at 10:02 AM, Andy Clement
<andrew.clement@xxxxxxxxx> wrote:
I think that would be great, and would provide a lot of flexibility - but it is quite a lot of work... Most cycles are going to get consumed on supporting Java 8 for the next little while. I'm sure when you start thinking about type annotations (jsr308) you are going to come up with a million new AspectJ use cases...
For strings I might be happier with using a regex of some kind rather than getting into what methods are or are not allowed.
@Foo(value =~ "/^goo.*/")
For numbers the usual set of operators seem ok. I'm still waiting for someone to tell me the best operator for that 'member of array' construct we were talking about previously:
@Foo({1,2,3})
declare @type: @Foo(value ???? 1): @ContainsOne;
cheers,
Andy
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
--
Archie L. Cobbs