[aspectwerkz-dev] args() pointcut selector and Pointcut as methods.

"Alexandre Vasseur" <alex-he/e8N7AIe/[email protected]>
Newsgroups gmane.comp.java.aspectwerkz.devel
Message-ID <[email protected]>
Hi

If anyone is interested in testing new features that will soon be out, there
is support for Pointcut with signature in cvs head - that is "args()" syntax
as introduced by AspectJ.

/** @Expression execution(* method(..)) && args(s, int) */

Pointcut myPC(String s) {return null;} // it is a method ! - could be "void
myPC(String s) {}" instead as well.

// will match all "method" with "(String, int)" signature.

/** @Before myPC(s) */

Void myBefore(JoinPoint jp, String s) {

System.out.println(s);// no more RTTI access !

}

The same can be achieve thru XML as well though it tends to be painfull.

This features is covered by a test suite for method execution pc.

I will add coverage for constructor, call pc and field set soon.

If you need doc on that, do a maven site:generate, or check
src/test/test.args.*

Feedback welcome.

Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.