Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Updating a returned variable

Hi,
Simple question time! Can I update a property on a returned object with an
aspect.

Suppose I have a method:

public MyObject myMethod() {
    // Code which changes MyObject
}


I wish to have an aspect which will change a property on MyObject. I know I
can use an around advice, can be used to return a specific MyObject
reference, but I want to get the existing MyObject reference and just change
a property on it, something like

myObject.setAge(27);

I don't want to change anything else.

Any ideas? 

Thanks


-- 
View this message in context: http://www.nabble.com/Updating-a-returned-variable-tp16743318p16743318.html
Sent from the AspectJ - users mailing list archive at Nabble.com.



Back to the top