[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] generic access to method arguments
|
You want thisJoinPoint.getArgs(). See
http://www.eclipse.org/aspectj/doc/released/progguide/language-thisJoinPoint
.html for more information...
-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Abramovich, Dan
Sent: Wednesday, September 06, 2006 1:23 PM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] generic access to method arguments
Hi,
I have a pointcut that is picking out all methods that have a particular
annotation. This works fine.
public pointcut withMyAnnotation(MyAnnotation myAnnotation) :
execution(@MyAnnotation * *(..)) &&
@annotation(myAnnotation);
Object around(MyAnnotation myAnnotation) :
withMyAnnotation(myAnnotation) {
What I don't know how to do is have access to the method arguments without
restricting what the arguments are. I'd like to have a list of all the
arguments (maybe empty) that were actually passed in to the advised method
without knowing/limiting which methods are advised. Something like: (I know
it doesn't work, but I think it expresses the sentiment).
public pointcut withMyAnnotation(MyAnnotation myAnnotation,
Object[] arguments) :
execution(@MyAnnotation * *(..)) &&
@annotation(myAnnotation) && args(arguments);
Object around(MyAnnotation myAnnotation, Object[] arguments) :
withMyAnnotation(myAnnotation, arguments) {
Any help? Is this possible?
-Dan
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users