Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Exposing state held in method annotations

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all.

Today I came across an annotation problem which I don't know how to
solve:

I have a method annotated like this:

@ConstantArguments({1}) public int foo(Wrapper a) {
..
}

Now I am matching on calls to it like this:

pointcut constantArgumentMethods() : call(@ConstantArguments *
*.*(..));

But how can I expose the "value" state "{1}" that I passed in above?
The following does *not* work:

pointcut constantArgumentMethods(int[] value) :
call(@ConstantArguments(value) * *.*(..));

I guess @target will not help, since it returns annotations of the
target *type*, not *method*, or am I wrong?

Cheers,
Eric

P.S. Definition of the ynnotation type:

public @interface ConstantArguments {

    int[] value() default {};
    
}

- -- 
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQfkyNMwiFCm7RlWCEQJUvwCdF6oPnnOj0IOrwgK3oqBFsEG+f+EAn1lW
n+BcQ4OfJRo3KlGuMlt7q+3Y
=IJhX
-----END PGP SIGNATURE-----




Back to the top