Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] IDT - separating getter/setter from beans

Hi Roger,
yes, you can do it, but you have to specify to which class you are attaching them :

public aspect MyTestBeanSupport {

   public void MyTest.setData1(String data) {
       this.data1 = data1;
   }

   public Strng MyTest.getData1() {
       return data1;
   }

}

Simone


2010/5/26 Roger Gilliar <roger@xxxxxxxxxx>
Is it possible to separate the getter setters into an aspect ?

I tried to use static aspect Pmpl to introduce the getter setters but they can't access the variables defined in the main class.

Something like

public class MyTest() {
   String data1;
}


public aspect MyTestBeanSupport {

   public void setData1(String data) {
       this.data1 = data1;
   }

   public Strng getData1() {
       return data1;;
   }

}

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top