Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Get annotation value on field setting

The AspectJ 5 developer's notebook suggests this should work:

  before(MyAnnot mine) : set(String myField)
      && @annotation(mine) {
      System.out.println("test.something=" + test.something());
  }

But binding is not implemented yet for annotations.

Wes

> ------------Original Message------------
> From: Rifflard Mickaël <Mickael.Rifflard@xxxxxxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Mon, Jan-31-2005 1:06 AM
> Subject: [aspectj-users] Get annotation value on field setting
>
> Hi,
> 
> I try to retrieve an annotation value of a field during its setting.
> 
> Exemple : 
> 
> 	public class MyClass {
> 
> 		@MyAnnot(test)
> 		public String myField;
> 
> 		public void myMethod() {
> 			...
> 			// Try to get myField annotation value here
> 			this.myField = "newValue";
> 			...
> 		}
> 	}
> 
> How to obtain this information (test) without reflexion ?
> 
> Thanks,
> 
> Mickaël Rifflard
> (Atos Origin)
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 




Back to the top