Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] how to generate AspectJ code?

Hi Vijay,

As Wes points out the purpose of the ASM API is not code generation.
However, in AspectJ 1.2 the IPorgramElement nodes do contain enough
information to generate classes with fields and method signatures.  That's
what ajdoc does: it starts out by walking the entire ASM and dumping .java
files with all member signatures (but no method bodies). 

But for the ASM to have the information you want a compile needs to take
place.  We have no equivalent to the AST emission APIs of Eclipse, although
those would be very nice to have at some point.  So depending on what you're
doing, you could consider using the ASM as ajdoc does, or wait until the
next generation of AJDT which extends the JavaModel and should make code
generation easier, or try to extend the Eclipse code generation API
yourself.  The latter would make for a useful contribution.  In any case, we
would be interested in hearing about what you learn.

Cheers,

Mik

> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx [mailto:aspectj-users-
> admin@xxxxxxxxxxx] On Behalf Of Vijay Mariadassou
> Sent: Monday, April 26, 2004 9:08 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] how to generate AspectJ code?
> 
> Hello,
> I am experimenting with Eclipse plug-ins and AJDT and
> I am trying to add a submenu to the editor that would
> allow users to add aspects for a method in a .java
> file without having to actually write any AspectJ
> code.
> 
> I was wondering if I could create ProgramElements in
> memory and then use some API to generate an AspectJ
> source file using the ProgramElements.
> Thanks in advance.
> Vijay
> 
> 
> --- Wes Isberg <wes@xxxxxxxxxxxxxx> wrote:
> > I don't believe we have any API's to generate
> > AspectJ code;
> > that's not what ProgramElement is for.
> >
> > Perhaps if you tell people what you're trying to do,
> > they can help.
> >
> > Wes
> >
> > Vijay Mariadassou wrote:
> >
> > > Hello All,
> > > I am trying to generate AspectJ code using a
> > > org.aspectj.asm.internal.ProgramElement instance.
> > I
> > > looked at all the source code in the ajde,
> > ajbrowser
> > > and asm modules but, could not find any use of
> > > ProgramElement to write AspectJ code.
> > > I would greatly appreciate any help in this
> > regard.
> > > Thanks,
> > > Vijay
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Photos: High-quality 4x6 digital prints for
> > 25"
> > > http://photos.yahoo.com/ph/print_splash
> > > _______________________________________________
> > > aspectj-users mailing list
> > > aspectj-users@xxxxxxxxxxx
> > >
> >
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> >
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25"
> http://photos.yahoo.com/ph/print_splash
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top