Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] "Can define an AspectJ with a hasmethod Pointcut for...?"

Since hasmethod() may be used only in 'declare parents' statements, you cannot avoid using an interface as an intermediary. One this you can do is use a *private* interface as an intermediary in the aspect. This will prevent the interface being exposed to other types in the system.

-Ramnivas

On Dec 19, 2007 9:17 PM, Henrique Mostaert <henrique.mr@xxxxxxxxx> wrote:
Hello all,

  This issue started in the previous topic "Help with hasmethod() and hasfield() pointcuts". In this way, I mentioned the real point that I really want in my last commentary in this previous topic. So, I decided to put it in a new topic in order to give more discussion about.

  He we go :

     (1) My main question now is:

      Consider the following example:

          class C {

           public void x(){}
         }

         aspect C{

             // Verify if the method "public void x(){}" exists in Class C (using the hasmethod() pointcut), and if exists, (our case), inserts a method into C using the inter-type declaration like:

             public boolean C.checkSomeProperties(){}
        }

      QUESTION: Is there a way to provide this behavior in AspectJ without using an Interface as intermediate ??


   Regards!!

  

--
Henrique Mostaert, Departamento de Sistemas Computacionais, UPE


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



Back to the top