Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] A newbie writes

Title: A newbie writes

Hi all -

This is my first post to the list.

I'm just getting my head round AOP and have been making reasonably good progress so far (I'm using the AJDT plugin for Eclipse).

However, I can't seem to work out how to do a simple pointcut.

I want to be able to inspect the value of Strings whenever they are accessed.

I thought this would do it:

        pointcut fieldtest(String s) : target(s) && get(* *.*);

        before(String s) : fieldtest(s) {
                System.out.println("String value read: " + s);
        }

But it's not being triggered. 

I can't find any examples in the documentation showing how to do this sort of thing.

Any suggestions would be greatly appreciated.


Robbie


__________________________________________________
This electronic message contains information which may be privileged and confidential.  The information is intended to be for the use of the individual(s) or entity named above.  If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited.  If you have received this electronic message in error, please notify us by telephone on 0131 476 6000 and delete the material from your computer.


Back to the top