Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Intercepting array index using field get/set

Hi,

(I'm not sure what you mean by "[]operator overloading".)

Using AspectJ as it stands, it's not possible to get the array indexes when you are accessing an array.

It shouldn't be too difficult to have a new pointcut for array accesses, since it's been done quite easily in abc:
http://abc.comlab.ox.ac.uk/archives/users/2004-Nov/0012.html
http://abc.comlab.ox.ac.uk/talks#aosd05tutorial

Regards,

Bruno.


--
http://www.cs.man.ac.uk/~harbulob/
http://www.cs.manchester.ac.uk/cnc/projects/loopsaj/


Shahzad Bhatti wrote:
Hi,
I am wondering if it is possible to intercept an array index, i.e., similar to []operator overloading. I have been trying to do something like public pointcut captureGet(Object caller) : get(* MyClass.*) && this(caller); // possibly add if(Array) to the condition public pointcut captureSet(Object caller) : set(* MyClass.*) && this(caller); // possibly add if(Array) to the condition

  Object around(Object caller) : captureGet(caller) {
// find my own object based on the index and return, e.g. return proceed(myownindex);
  }
  void around(Object caller) : captureSet(caller) {

    proceed(myown-index);
  }





Back to the top