[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] set pointcut on a field, and all its fields

Hi!

I need to make a pointcut when the field "localTranslation" on the target
Spatial is changed. The code below works great, but...

it's just that sometimes the localTranslations fields are changed, like this
f.ex: localTranslation.x = 0.5;

I need the pointcut to include those changes of localTranslation too. Is
there a solution to this?

pointcut localTranslationSet(Spatial spatial, Vector3f localTranslation):
	set(Vector3f Spatial+.localTranslation)
	&& !withincode(Spatial+.new(..))
	&& target(spatial)
	&& args(localTranslation);

after(Spatial spatial, Vector3f localTranslation) returning:
localTranslationSet(spatial, localTranslation) {
	if(shouldNotBeIgnored(spatial)) {
		JMEEventReporter.localTranslationSet(new
LocalTranslationSetEvent(getAddress(spatial), spatial.hashCode(),
localTranslation));
	}
}
-- 
View this message in context: http://www.nabble.com/set-pointcut-on-a-field%2C-and-all-its-fields-tp19980025p19980025.html
Sent from the AspectJ - users mailing list archive at Nabble.com.