jboss-aop.xml
<annotation-introduction expr="constructor(POJO->new())"> @complex (ch='a', string="hello world", flt=5.5, dbl=6.6, shrt=5, lng=6, integer=7, bool=true, annotation=@single("hello"), array={"hello", "world"}, clazz=java.lang.String) </annotation-introduction>
It is pretty simple, define an expression within the expr attribute. constructor(), method(), class(), and field() all take a corresponding expression of that type. You can also use the has() and hasfield() operators as well if you wish and any boolean expression with those 6 operators.
THIS EXAMPLE REQUIRES JDK 5!! For other options, please look at the annotated examples guide To compile and run:
$ run.aopc.50
It will javac the files and then run the AOPC precompiler to manipulate the bytecode, then finally run the example. The output should be similar to this:
_run.aopc.50: [java] --- new POJO(); --- [java] @single ("hello world") [java] @complex (ch='a', "hello world", flt=5.5, dbl=6.6, ...blah blah blah YOU GET THE IDEA... [java] <<< Trace : executing constructor public POJO() [java] empty constructor [java] >>> Leaving Trace [java] --- pojo.someMethod(); --- [java] @single ("hello world") [java] @complex (ch='a', "hello world", flt=5.5, dbl=6.6, ...blah blah blah YOU GET THE IDEA... [java] <<< Trace : executing method public void POJO.someMethod() [java] someMethod [java] >>> Leaving Trace [java] --- pojo.field = 55; --- [java] @single ("hello world") [java] @complex (ch='a', "hello world", flt=5.5, dbl=6.6, ...blah blah blah YOU GET THE IDEA... [java] <<< Trace : write field name: public int POJO.field [java] >>> Leaving Trace