Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Is AspectJ capable of modifying source code?

AFAIK one of the earliest versions of AspectJ used to do source code
transformation but now that's all done on the bytecode level. Why
would you want to do this on source code anyway?

Eric

On 24/05/07, Angel Todorov <attodorov@xxxxxxxxx> wrote:
Hi all,

I am very new to AspectJ and I would like to know whether AspectJ can
modify existing source code ? Is there some post-processing way of
injecting (the results of) invoking aspects in the source code , in
design/build  time?

For instance, I would like to insert some java statement whenever some
method X of class Y is called. I would like to do that with an aspect,
but I would like AspectJ to actually modify the source code not to
"invoke" the stuff at runtime (or inject it at classload time).

The easiest alternative to me is, of course, to use regular
expressions, parsing , and similar "hacks", but I would prefer a
cleaner solution that is semantic-aware and always guaranteed to
insert statements at the correct location.

Thank you very much for your feedback.

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



--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


Back to the top