[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] How to return from the method ?
|
You want to be using around advice. Something like:
void around(Object input) : setterPointcut(input){
if (input != null) {
proceed(input);
}
}
The important thing here is that 'proceed' is not called if input is
null. Hope this helps.
On Thu, Apr 15, 2010 at 5:48 AM, Rajat Gupta <innocent_person1@xxxxxxxxx> wrote:
> Hi All,
>
> I had a aspect, and java file.
>
> If input is null then i want to return from method.
> currently i am just returning from the aspect.
>
> so basically, i want that following line should not execute.
> System.out.println("Printing .... ");
>
> It should be equivalent to following code.
> public void jsSet_print(String xyz) throws Exception, IOException {
> if(xyz!= null){
> System.out.println("Printing .... ");
> }
> }
>
> If it is not possible using before, how can i do this?
>
> Is this is possible by around ?
>
> File attached.
>
> Thanks a lot.
> Rajat
>
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>