Novice question on the use of static introductions [message #9264] |
Fri, 25 October 2002 14:38  |
Eclipse User |
|
|
|
Originally posted by: john_daly.hp.com
Hello,
I'm attempting to use static introductions in a code based with the
following package structure and would like to have the stated
introductions weaved into all classes from 'src' package down recursively.
Package Structure
------------------------------------------------------------ ------
src (main package)
src.shp (shape package including a sample shape class: Shape.java)
src.shp.tst (tst packagge including sample test class: Test.java)
src.log (log package including sample logger aspect: Logger.java)
Logger Aspect
------------------------------------------------------------ -------
public aspect Logger
{
public static void (src.*.*.*).fatal(Object message)
{
System.out.println(message);
}
}
In the code above the 'src.*.*.*' introduces the method 'fatal' only into
the
'Test.java' class found in 'src.shp.tst'but not into any of the classes
above it in the package hierarchy.
Is there a syntax for specifying all classes in all packages below a
certain package level? I'm thinking of something similar to the mechanism
for selecting subtypes(i.e. Shape+)but have been unsuccessful in determing
if such a selection mechanism exists.
Thanks in advance for any pointers or thoughts.
|
|
|
|
Re: Novice question on the use of static introductions [message #9349 is a reply to message #9325] |
Mon, 28 October 2002 11:51  |
Eclipse User |
|
|
|
Originally posted by: john_daly.hp.com
Julie,
Thanks for the response and sorry for the incorrect newsgroup post.
-jd
Julie Waterhouse wrote:
> Hi John,
> The wildcard pattern src..* will match every class in the src package, its
> subpackages, and inner classes. (You could also be more specific with
> src.shp..* etc if you wanted).
> FYI for the future, the best place to ask these kinds of questions is on
> the AspectJ mailing list. See
>
http://aspectj.org/servlets/AJSite?channel=userCommunity& ;subChannel=mailingLists
> This newsgroup is primarily for issues dealing with the AJDT plugin to
> Eclipse.
> Regards,
> Julie Waterhouse
> AJDT Development Team
> John Daly wrote:
> > Hello,
> > I\\\'m attempting to use static introductions in a code based with the
> > following package structure and would like to have the stated
> > introductions weaved into all classes from \\\'src\\\' package down
recursively.
> > Package Structure
> > ------------------------------------------------------------ ------
> > src (main package)
> > src.shp (shape package including a sample shape class: Shape.java)
> > src.shp.tst (tst packagge including sample test class: Test.java)
> > src.log (log package including sample logger aspect: Logger.java)
> > Logger Aspect
> > ------------------------------------------------------------ -------
> > public aspect Logger
> > {
> > public static void (src.*.*.*).fatal(Object message)
> > {
> > System.out.println(message);
> > }
> > }
> > In the code above the \\\'src.*.*.*\\\' introduces the method
\\\'fatal\\\' only into
> > the
> > \\\'Test.java\\\' class found in \\\'src.shp.tst\\\'but not into any of
the classes
> > above it in the package hierarchy.
> > Is there a syntax for specifying all classes in all packages below a
> > certain package level? I\\\'m thinking of something similar to the
mechanism
> > for selecting subtypes(i.e. Shape+)but have been unsuccessful in determing
> > if such a selection mechanism exists.
> > Thanks in advance for any pointers or thoughts.
|
|
|
Re: Novice question on the use of static introductions [message #562367 is a reply to message #9264] |
Mon, 28 October 2002 08:20  |
Eclipse User |
|
|
|
Hi John,
The wildcard pattern src..* will match every class in the src package, its
subpackages, and inner classes. (You could also be more specific with
src.shp..* etc if you wanted).
FYI for the future, the best place to ask these kinds of questions is on
the AspectJ mailing list. See
http://aspectj.org/servlets/AJSite?channel=userCommunity& ;subChannel=mailingLists
This newsgroup is primarily for issues dealing with the AJDT plugin to
Eclipse.
Regards,
Julie Waterhouse
AJDT Development Team
John Daly wrote:
> Hello,
> I\'m attempting to use static introductions in a code based with the
> following package structure and would like to have the stated
> introductions weaved into all classes from \'src\' package down recursively.
> Package Structure
> ------------------------------------------------------------ ------
> src (main package)
> src.shp (shape package including a sample shape class: Shape.java)
> src.shp.tst (tst packagge including sample test class: Test.java)
> src.log (log package including sample logger aspect: Logger.java)
> Logger Aspect
> ------------------------------------------------------------ -------
> public aspect Logger
> {
> public static void (src.*.*.*).fatal(Object message)
> {
> System.out.println(message);
> }
> }
> In the code above the \'src.*.*.*\' introduces the method \'fatal\' only into
> the
> \'Test.java\' class found in \'src.shp.tst\'but not into any of the classes
> above it in the package hierarchy.
> Is there a syntax for specifying all classes in all packages below a
> certain package level? I\'m thinking of something similar to the mechanism
> for selecting subtypes(i.e. Shape+)but have been unsuccessful in determing
> if such a selection mechanism exists.
> Thanks in advance for any pointers or thoughts.
|
|
|
Re: Novice question on the use of static introductions [message #562391 is a reply to message #9325] |
Mon, 28 October 2002 11:51  |
Eclipse User |
|
|
|
Originally posted by: john_daly.hp.com
Julie,
Thanks for the response and sorry for the incorrect newsgroup post.
-jd
Julie Waterhouse wrote:
> Hi John,
> The wildcard pattern src..* will match every class in the src package, its
> subpackages, and inner classes. (You could also be more specific with
> src.shp..* etc if you wanted).
> FYI for the future, the best place to ask these kinds of questions is on
> the AspectJ mailing list. See
>
http://aspectj.org/servlets/AJSite?channel=userCommunity& ;subChannel=mailingLists
> This newsgroup is primarily for issues dealing with the AJDT plugin to
> Eclipse.
> Regards,
> Julie Waterhouse
> AJDT Development Team
> John Daly wrote:
> > Hello,
> > I\\\'m attempting to use static introductions in a code based with the
> > following package structure and would like to have the stated
> > introductions weaved into all classes from \\\'src\\\' package down
recursively.
> > Package Structure
> > ------------------------------------------------------------ ------
> > src (main package)
> > src.shp (shape package including a sample shape class: Shape.java)
> > src.shp.tst (tst packagge including sample test class: Test.java)
> > src.log (log package including sample logger aspect: Logger.java)
> > Logger Aspect
> > ------------------------------------------------------------ -------
> > public aspect Logger
> > {
> > public static void (src.*.*.*).fatal(Object message)
> > {
> > System.out.println(message);
> > }
> > }
> > In the code above the \\\'src.*.*.*\\\' introduces the method
\\\'fatal\\\' only into
> > the
> > \\\'Test.java\\\' class found in \\\'src.shp.tst\\\'but not into any of
the classes
> > above it in the package hierarchy.
> > Is there a syntax for specifying all classes in all packages below a
> > certain package level? I\\\'m thinking of something similar to the
mechanism
> > for selecting subtypes(i.e. Shape+)but have been unsuccessful in determing
> > if such a selection mechanism exists.
> > Thanks in advance for any pointers or thoughts.
|
|
|
Powered by
FUDForum. Page generated in 0.03682 seconds