Skip to main content



      Home
Home » Language IDEs » AspectJ » Novice question on the use of static introductions
Novice question on the use of static introductions [message #9264] Fri, 25 October 2002 14:38 Go to next message
Eclipse UserFriend
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 #9325 is a reply to message #9264] Mon, 28 October 2002 08:20 Go to previous messageGo to next message
Eclipse UserFriend
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 #9349 is a reply to message #9325] Mon, 28 October 2002 11:51 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:ADJT and workspace build errors
Next Topic:Specification of Build Path - Output
Goto Forum:
  


Current Time: Thu Apr 24 00:06:47 EDT 2025

Powered by FUDForum. Page generated in 0.03682 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top