Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] loading and traversing aspects (.aj files)

I am not exactly sure what you are trying to do.

I think you are saying that you want to do some code generation in
C.aj based on the state of your A.java and B.java files.

If this is the case, then you do not need to create your own builder,
but rather you need to implement and register an
IResourceChangeListener object with the workspace.  This listener will
be notified whenever a workspace resource is changed.  You should look
at the eclipse documentation for more information on this.

As for the code generation, yes, you may need to use the AjAST for
this.  It is similar to the JDT DOM api, so have a look at that.

I may have misinterpreted what you are trying to do, so please explain
more precisely and I can give a more detailed answer.

On Sat, Mar 13, 2010 at 7:51 AM, saadbin abid
<saad.softwareengineer@xxxxxxxxx> wrote:
> Hello Aspectj Community,
> I am a newbie to AspectJ and AJDT world. I am currently working with a aj
> implementation. In aspectj project I have aspects and java files (.aj and
> .java files).For the start I am working out with  simple example of
> "helloworld" for developing a simple prototype. I have two java classes
> A.java, B.java and one aspect C.aj. C.aj has something like
>
> - If A.java and B.java are running, than put additional functionality (for
> example extend A.java with additional functionality if B.java is selected).
>
> A.java
>
> sayA()
> {print "sayA"}
>
> B.java
>
> sayB()
> {print "sayB"}
>
> C.aj (if A.java and B.java both are enable)
>
> sayAandB()
> {put "And" after running A.java and then execute B.java}
>
> after executing ant script build.xml
>
> print "SayA" "and" "SayB"
>
> I would like to implement a incremental builder plug-in which will run in
> the eclipse runtime environment and  traverse the .aj file and give me
> information like which java classes are affected? My questions are
>
> What could be the possible starting point?
> Do I have to workout with AjAST? although in the project I dont have many
> aspects in the project implementation.
> Can I traverse .aj file without creating AST?
> Is it possible to load .aj files using some code? (for example in my case
> can I load C.aj file with some code?)
>
>  Can you help me with this. I didn't get too far with the tutorial
> "Developer's guide to building tools on top of AJDT and AspectJ".
>
> best regards
> --
> SAAD
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


Back to the top