Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] (no subject)

On Tue, 2003-06-17 at 06:44, Ken Horn wrote:
> How about something like (untested syntax):
> 
> String around() : call(* *.getAString()) {
>       String origString = proceed();
>       // do the test for variables
>       if (origString.indexOf("$") >= 0) {
>             String changedString = ... // eval vars
>             return changedString;
>       }
>       return origString;
> }
> 
> Not sure if the getAString was a specific method or an example signature.

I have tried variants of the above but I'm not getting quite what I
want. I actually need to know when the call starts with the Project
(shown below) because it is the object which contains the Map of values
I would like to interpolate into the String.

I figured I would need a flow construct of some sort. I'll keep
experimenting! 

> Hi,
> 
> Say I have the following:
> 
> Project p = createProject( f );
> String s =  p.getN0().getN1().getN2()...getNM().getAString()
>            ^
>            ^
>                 I
> 
> What is the best way to intercept the String returned by this call chain
> to perform some transformation?
> 
> Specifically p is an object that is created by unmarshalling an XML
> document which may contain ${foo} references. I would like to check I
> for any of these references and interpolate the real value of foo into
> the String before returning it to the caller.
> 
> --
> jvz.
> 
> Jason van Zyl
> jason@xxxxxxxxxxx
> http://tambora.zenplex.org
> 
> In short, man creates for himself a new religion of a rational
> and technical order to justify his work and to be justified in it.
> 
>   -- Jacques Ellul, The Technological Society
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 
> 
> 
> 
> --
> 
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
-- 
jvz.

Jason van Zyl
jason@xxxxxxxxxxx
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society



Back to the top