Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321820

Summary: Declare annotation to a method param
Product: [Tools] AspectJ Reporter: alcoholitro
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: aclement, alcoholitro
Version: 1.6.9M2Keywords: usability
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description alcoholitro CLA 2010-08-05 03:06:56 EDT
AspectJ would support a declaration rule to method params.

I.E.: I want to publish a service as a web service. I need to annotate the params of a method with @WebParam.

AspectJ supports the declaration of annotations in the method and has a syntax to check params with pointcuts:

    pointcut p1(): execution(public * (@Controller *).*(@MyParamAnnotation (*),..)); 

I proposed this syntax to assign annotations to paramas:

    declare @param * *(*, Class className, ..) : @Annotation(annotationParameter = "value");

Result: assign the annotation '@Annotation(annotationParameter = "value")' to the type of param 'Class' with the name 'className'.

It has to be declared for each param to assign individually the annotation.

I think it would be a necessary improvement to increase the productivity of AspectJ.

Thank you.
Comment 1 alcoholitro CLA 2010-09-17 04:57:07 EDT
Hi!

Is there any news on this subject ?

I've linked this improvement to Spring-ROO AspectJ generation. It could be very useful for both.

JIRA: 

* https://jira.springsource.org/browse/ROO-1390

Thank you !
Comment 2 Andrew Clement CLA 2010-09-17 10:24:02 EDT
nope, no news on this yet.  When changes are made this bug will be updated.
Comment 3 Andrew Clement CLA 2013-06-24 11:05:24 EDT
unsetting the target field which is currently set for something already released