Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do .. and * mean in aspectj

My understanding is that .. is 0-Many args and * is one arg of any name. Is this correct?

Does aspectj support syntax like args(..,myArg,..)?

like image 742
MikePatel Avatar asked Sep 06 '12 15:09

MikePatel


People also ask

How does AspectJ works?

What AspectJ does is always pretty much the same: It modifies Java byte code by weaving aspect code into it. In case 1 you just get one set of class files directly from ajc . Case 2.1 creates additional, new class files. Case 2.2 just creates new byte code in memory directly in the JVM.

What is Pointcut in AspectJ?

AspectJ provides primitive pointcuts that capture join points at these times. These pointcuts use the dynamic types of their objects to pick out join points. They may also be used to expose the objects used for discrimination. this(Type or Id) target(Type or Id)

Which annotation in AspectJ helps us to identify aspects?

The @Aspect annotation on a class marks it as an aspect, and hence excludes it from auto-proxying.

How do I enable AspectJ support?

To enable @AspectJ, spring AOP provides @EnableAspectJAutoProxy annotation which will be annotated in java configuration. To work with spring AOP and @AspectJ support, we need to create a class annotated with @Aspect annotation.


1 Answers

This is from AspectJ site: http://www.eclipse.org/aspectj/doc/next/progguide/semantics-pointcuts.html

* represents any number of characters except "."

.. represents any number of characters including any number of "."

Update From AspectJ in Action - for method signatures:

In method signatures, the wildcard .. is used to denote any type and number of arguments taken by a method

* specifies a single argument

like image 80
Biju Kunjummen Avatar answered Sep 22 '22 21:09

Biju Kunjummen