peterh
peterh

Reputation: 1

How to convert aspect java (.aj) to .java?

I thought ever it could be very nice, if the weaving and the actual compilation happened in different steps. Is there any not-really-well-known flag, or some such alternate solution to generate the intermediate .java code?

Anyways, weaving happens on the classes, or on the java source?

Upvotes: 0

Views: 575

Answers (2)

Andy Clement
Andy Clement

Reputation: 2560

Dave is right that weaving happens on bytecode (been that way since version 1.2). But you are still able to compile things separately and do weaving later. Build your regular java code as normal into a jar, then build your aspects into an aspect library, then just apply one to the other:

ajc -aspectpath myaspects.jar -inpath mycode.jar -outjar mywovencode.jar

Effectively that is compiling and weaving happening in different steps.

Upvotes: 0

Dave Newton
Dave Newton

Reputation: 160181

Weaving happens on the bytecode.

You might be able to disassemble the resulting bytecode, though.

Upvotes: 2

Related Questions