[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[aspectj-users] postprocessing of java code
|
- From: "Angel Todorov" <attodorov@xxxxxxxxx>
- Date: Wed, 23 May 2007 14:39:37 +0300
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=DECyrktyshupHRfcA4o4AMErETwRV36S3gkgl3q1ItBQZngTW5seXEMTmeEDnzZAzqaAXD6fgO82kaSq0fFt3YjhUQP9r6JZDZ4GeJrG8rr3ein2qJk60f85aeJSAT8nb3D2cF20s9i0fTXdC70PCx/LynCSHMZXfjbEYjXmtDU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ECOGpZKdgBiQGjqYQ0PdfwryExi+p551RNbNNsp/uTH3jCoRfD9KOVY+zHysGy4JRjIIPIhFuq4uRWo3GAXDeL9l8dUCNHTkig6U+5gEfb/eUfyYL+JejtnV4g46zL78Yt8IQXUjd/x3qBx+u9lfn+ecnpzziWP2khjgMcAddAY=
Hi all,
I would like to ask you if AspectJ is suitable for me to do the following task:
I have some already written java code (*.java) and I would like to
insert some special statements based on conditions. For example -
inserting a statement after some other statement (i.e. if a method M
of an instance of class X is called, insert statement S after that
call ...). I would like to be able to load that java code i some
format in memory (abstract syntax tree, maybe done by Aspectj anyway?)
,
modify that (i guess this is done automatically by aspectJ) , and then
serialize back to a *.java source file.
I don't want to use hacks (regular expressions, scripts, and so
forth), because it is critical that the modified code is not corrupt
later on and is guaranteed to compile at least :))
Is that easily achievable by using AspectJ ? Thank you very much in advance.
Best Regards,
Angel