Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Trying to capture a method on a nested class

Kevin,

 The code was a bit unclear it should read

 CookieRecipe.getCookieObject().setValue(new CookieObject());
 CookieRecipe.getRaisinObject().setValue(new RaisinObject());
 CookieRecipe.getFlourObject().setValue(new FlourObject());

 Which will set the CookieObject on the CookieRecipe in the
CookierRecipeLoader class 


Thanks for the reply 


Hugh McBride
Curam Software


-----Original Message-----
From: Keven Ring [mailto:keven@xxxxxxxxx] 
Sent: 06 April 2005 13:06
To: AspectJ developer discussions
Subject: Re: [aspectj-dev] Trying to capture a method on a nested class

Hugh McBride wrote:

>To all
>
>I have a series of classes i.e CookieObject, RaisinObject,  FlourObject,
>ButterObject etc that are contained in another class called CookieRecipe
and
>are set like so 
>
> public class CookieRecipeLoader
>{
>  
> CookieRecipe.getCookie().setValue(new CookieObject());
> CookieRecipe.getRaisin().setValue(new RaisinObject());
> CookieRecipe.getFlour().setValue(new FlourObject());
>
>
>}
> 
>
>
> I am trying to generate a error when the setValue is called on any
> Of the getters i.e. getCookie(), getRaisin() etc
>
>  
>
Um, your semantics are incorrect - you are not invoking the setValue 
method on any of the getter methods, rather, you are invoking the 
setValue method on the /return value/ from the getter methods.

That is, your statements above are semantically equivelant to:
Cookie c = CookieRecipe.getCookie();
c.setValue(new CookieObject());

> Have tried the code below 
>
> declare error: call((* CookieRecipe.get*.setValue(..) ) &&
>!within(CookieRecipeLoader)): "Illegal to add Ingredient outside cookie"; 
>
>
>It seems that I cant get past the getters, does anyone know the right
syntax
>
>To use , or can it be done at all 
>
>Thanks
>Hugh McBride
>
>The information in this email is confidential and may be legally
privileged.
>It is intended solely for the addressee. Access to this email by anyone
else
>is unauthorized. If you are not the intended recipient, any disclosure,
>copying, distribution or any action taken or omitted to be taken in
reliance
>on it, is prohibited and may be unlawful. If you are not the intended
>addressee please contact the sender and dispose of this e-mail. Thank you.
>_______________________________________________
>aspectj-dev mailing list
>aspectj-dev@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>  
>

The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful. If you are not the intended
addressee please contact the sender and dispose of this e-mail. Thank you.


Back to the top