Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] staticinitializer

Jake,

You should be able to use:

	thisJoinPointStaticPart.getSignature().getDeclaringType()

This should give the java.lang.Class of the current class that the join
point is executing within.

Hope this helps.

Ron

-----Original Message-----
From: Jake Whitehill [mailto:jrw@xxxxxxxx] 
Sent: Wednesday, February 05, 2003 2:08 PM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] staticinitializer


Hi,

I'm trying to implement the following:

I have three classes A, B, and C. In all three classes the static variable x
appears. I want to use advice to write static-initializer code for A, B, and
C which initializes the value of x to some class-dependent value. For
instance, I'd really like to have:

A.x = "A", B.x = "B", and C.x = "C"

But I don't know how to refer to the actual class being initialized from
within the static initializer.

Any suggestions?

Thanks
Jake


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.


Back to the top