Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] method call and annotated field

How to express this : Match a method call when this one is perform on an annotated field ?

Exemple : 

	@Target(ElementType.FIELD)
	@Retention(RetentionPolicy.RUNTIME)
	public @interface MyAnnotation { ... }
	
	public class MyClass {

		@MyAnnotation
		public Map myAnnotatedMap = new SortedMap();

		public Map myNotAnnotatedMap = new SortedMap();
	
		public static void main(String[] args) {
			...
			MyClass mc = new MyClass();
			mc.myAnnotatedMap.put(obj1,obj2);
			mc.myNotAnnotatedMap.put(obj1,obj2);
			...
		}
	}

My need in this exemple is to match put() method call when this one is performed on myAnnotatedMap and not on myNotAnnotatedMap.

Any help is appreciated.

Regards,

Mickaël RIFFLARD


Back to the top