Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Pointcut definitonn to capture annotations onparameters

Thx for the quick response.

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Alexandru
Popescu
Sent: Thursday, November 30, 2006 2:43 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Pointcut definitonn to capture annotations
onparameters

Nope package and parameter annotation matching is not supported yet:

http://www.eclipse.org/aspectj/doc/released/adk15notebook/annotations-po
intcuts-and-advice.html

(Package and Parameter Annotations

Matching on package and parameter annotations is not supported in
AspectJ 1.5.0. Support for this capability may be considered in a
future release. )

./alex
--
.w( the_mindstorm )p.


On 12/1/06, Gargan, Stephen <sgargan@xxxxxxxxxxxx> wrote:
>
>
>
>
> I have been trying to define a pointcut to capture annotations on
parameters
> in methods and I'm wondering if it is possible  i.e. one that could
capture
> the following based on the presence of the SimpleAnnotation
>
>
>
> public void setValue(int example, @SimpleAnnotation(type= "Method
> Parameter") String value)
>
> {
>
>       this.value = value;
>
> }
>
>
>
> It seems that the following definition will only capture annotations
on
> parameters if the parameter type contains the annotation
>
>
>
> pointcut executionSimplyAnnotatedParameter() : execution(*
> *.*(@SimpleAnnotation *)) ;
>
>
>
> capturing
>
>
>
> public void setAnnotatedType(AnnotatedType t){}
>
>
>
> @SimpleAnnotation(type = "Annotated")
>
> private class AnnotatedType{}
>
>
>
>
>
> Can parameter level annotations be the subjects of pointcuts?
>
> If so is it also possible to capture such joinpoints if the annotation
has a
> marker annotation introduced into the annotation?
>
>
>
> That is, given SimpleAnnotation is in the simple.annotation pkg
>
>
>
> declare @type : simple.annotation..*Annotation : @SimpleMarker;
>
>
>
> annotates SimpleAnnotation with the SimpleMarker annotation.
>
>
>
> Would it be possible to capture the above setValue Method based on
defining
> pointcuts with something along the lines of @(@SimpleMarker)
>
>
>
> Any light anyone can shed on this would be excellent.
>
>
>
> Thanks in advance,
>
>
>
> ste
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top