Annotation Type Arg

public @interface Arg

Use this annotation on advice parameters that should contain values of advised joinpoint arguments. What are the arguments of a joinpoint depends on the type of the joinpoint itself. For instance, if the intercepted joinpoint is a method execution, its arguments are the method arguments. If the optional index attribute is not defined, JBoss AOP will match the @Arg annotated parameter with the joinpoint argument closest with the closest type. Look at the following example: In this scenario, JBoss AOP will match To learn how JBoss AOP will match Arg annotated parameters with joinpoint arguments in more complex scenarios, please, refer to the Reference Manual documentation.

Flavia Rainone

Optional Element Summary
 int index
          Indicates which joinpoint argument this advice parameter refers to.


public abstract int index
Indicates which joinpoint argument this advice parameter refers to. When this value is not set, JBoss AOP will select the first joinpoint argument of the same type (or, if there is not such argument, the first joinpoint argument of an assignable type to the advice parameter).


Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.