|
Re: How to modify an AspectJ sourcefile [message #43526 is a reply to message #43327] |
Fri, 29 October 2004 13:41 |
Eclipse User |
|
|
|
Originally posted by: mchapman.uk.ibm.com
On Thu, 28 Oct 2004 21:32:47 +0200, Juergen Graf wrote:
> I'm developing a plug-in for eclipse, that uses Ajdt to analyse AspectJ
> projects. During the analysis I want to read and modify the sourcecode of
> some AspectJ files. In the JDK Plugin developers section of the eclipse
> help system it is said, that an ICompilationUnit object should be used for
> this purpose (retrieve WorkingCopy, modify, commit, ...). At this time
> I've only got the name (location) of the file I want to edit, but I don't
> know how to get an ICompilationUnit object.
>
> So how can this be done?
> Or is there another way to modify an AspectJ sourcecode file that should
> be used instead?
As far as I'm aware this is uncharted territory, outside of what AJDT
itself does (might be best to move discussion over to the ajdt-dev mailing
list). In the pure Java case, you can use
JavaCore.createCompilationUnitFrom() to get an ICompilationUnit object
from a file. In AJDT 1.2.0M1 onwards, we have AJCompilationUnits. If you
want to explore the source, places to start include:
org.eclipse.ajdt.javamodel.AJCompilationUnitManager in the
org.eclipse.ajdt.ui plugin, and
org.eclipse.ajdt.core.javaelements.AJCompilationUnit in the
org.eclipse.ajdt.core plugin.
Regards,
Matt.
|
|
|
Re: How to modify an AspectJ sourcefile [message #584532 is a reply to message #43327] |
Fri, 29 October 2004 13:41 |
Matt Chapman Messages: 429 Registered: July 2009 |
Senior Member |
|
|
On Thu, 28 Oct 2004 21:32:47 +0200, Juergen Graf wrote:
> I'm developing a plug-in for eclipse, that uses Ajdt to analyse AspectJ
> projects. During the analysis I want to read and modify the sourcecode of
> some AspectJ files. In the JDK Plugin developers section of the eclipse
> help system it is said, that an ICompilationUnit object should be used for
> this purpose (retrieve WorkingCopy, modify, commit, ...). At this time
> I've only got the name (location) of the file I want to edit, but I don't
> know how to get an ICompilationUnit object.
>
> So how can this be done?
> Or is there another way to modify an AspectJ sourcecode file that should
> be used instead?
As far as I'm aware this is uncharted territory, outside of what AJDT
itself does (might be best to move discussion over to the ajdt-dev mailing
list). In the pure Java case, you can use
JavaCore.createCompilationUnitFrom() to get an ICompilationUnit object
from a file. In AJDT 1.2.0M1 onwards, we have AJCompilationUnits. If you
want to explore the source, places to start include:
org.eclipse.ajdt.javamodel.AJCompilationUnitManager in the
org.eclipse.ajdt.ui plugin, and
org.eclipse.ajdt.core.javaelements.AJCompilationUnit in the
org.eclipse.ajdt.core plugin.
Regards,
Matt.
|
|
|
Powered by
FUDForum. Page generated in 0.01798 seconds