[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
Re: [aspectj-users] * in type patterns
|
- From: "Wes Isberg" <wes@xxxxxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 14:58:00 -0800
- Delivered-to: aspectj-users@eclipse.org
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; d=california.com; s=cookie; h=Received:To:Subject:From:Reply-To:In-Reply-To:References:X-Priority:Content-Type:Content-Transfer-Encoding:X-Mailer:Mime-Version:Message-Id:Date; b=y4egnTlcpno4kirLgDuioj5tOfgt/Vhkw55l7t4cBPRIBbBnWpg/max+HdJJA+u8o3Yn/GGbUHdDN7z4QI5yCMhcf7Z1eLnbNsaV1FCMh4L5N4z8luwB5S5AohtOYqV4VaK09LbI/WTYLW8nvqKpCLjkXyw7E3zQvnPBxlQHXQ0=
> However, when used like this:
>
> Pointcut p3() : call(public int *SomeClass.*(..));
>
> what is the meaning of * ? It is not embedded within a sequence of
> characters, and neither is it used "by itself." The meaning also seems
It is embedded, is it not? Does it not behave that way?
> 2. Why aren't SomeClass in all packages matched by p3?
The type is fully-qualified in this case. To match all packages,
specify *.. as the package prefix:
call(public int *..*SomeClass.*(..));
The case of * alone is special in picking out any type, regardless of package.
Wes
> ------------Original Message------------
> From: "Jon S. Baekken" <jbaekken@xxxxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Fri, Mar-31-2006 2:33 PM
> Subject: [aspectj-users] * in type patterns
>
> Everybody,
>
> I'm a little confused about the meaning of the * wildcard used in type
> patterns. From what I've read, * stands for zero or more occurrences of
> any
> character when used by itself. So,
>
> pointcut p1() : call(public int *.*(..));
>
> would match a call to any public method returning an in in any class in
> any
> package (visible to the compiler).
>
> When embedded within a sequence of characters, * stands for zero or
> more
> occurrences of character except the package separator (.), so
>
> pointcut p2() : call(public int somepackage.*.SomeClass.*(..));
>
> would match any public method returning an int declared in the class
> SomeClass in any direct subpackage of somepackage (right?)
>
> However, when used like this:
>
> Pointcut p3() : call(public int *SomeClass.*(..));
>
> what is the meaning of * ? It is not embedded within a sequence of
> characters, and neither is it used "by itself." The meaning also seems
> to be
> neither of those mentioned above. It appears that it matches calls to
> methods declared in any class whose name ends in "SomeClass", but only
> those
> classes visible from within p3's source file (which is also strange
> since I
> thought all types visible to the compiler were considered when using
> wildcards?).
>
> So to summarize my questions,
>
> 1. What exactly does the * stand for in p3?
> 2. Why aren't SomeClass in all packages matched by p3?
>
> Thanks,
> Jon
>
> http://www.eecs.wsu.edu/~jbaekken/
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>