[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [aspectj-users] Detect annotated method
- From: "Wes Isberg" <wes@xxxxxxxxxxxxxx>
- Date: Tue, 21 Mar 2006 08:44:48 -0800
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; d=california.com; s=cookie; h=Received:To:Subject:From:Reply-To:In-Reply-To:References:X-Priority:Content-Type:Content-Transfer-Encoding:X-Mailer:Mime-Version:Message-Id:Date; b=Cqum6dGhxQH+nGDQ+xUdQndxR68JFhaFTt9AW2iwkClQf98vVNkj3f6eI1Wy7lkVvWtr6u/Rf7CFqBrrFtxiLgEeZM4nUG0SxE7eCbtjtttoMDEG5QhKDv0VGn2guDZBL97bLSze1G+WQjJXwGiRX66qPDMPfLDs0EYUqGBNbPM=
Glad you found a way to do it; sorry you had to do it the hard way!
AspectJ 5 features are discussed outside the programming guide
(which will be fixed soon at least with forward references):
This section discusses signature patterns:
It says that the annotation must be first in any modifier list.
(In Java annotations can be anywhere in the modifier list,
though they recommend the annotations come first as a matter of style.)
> ------------Original Message------------
> From: "matsui akira" <akira_in_tokyo@xxxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Tue, Mar-21-2006 8:38 AM
> Subject: RE: [aspectj-users] Detect annotated method
> I just found a way to do it:
> Object around(): call(* *.*(..)) && !@annotation(MyAnnotation) &&
> sorry for this.
> I was too stuck to the Programming Guide
> (http://www.eclipse.org/aspectj/doc/released/progguide/index.html) and
> could not find references to annotation style matching.
> Anyway, is there any more comprehensive reference than the programming
> >From: "matsui akira" <akira_in_tokyo@xxxxxxxxxxx>
> >Reply-To: aspectj-users@xxxxxxxxxxx
> >To: aspectj-users@xxxxxxxxxxx
> >Subject: [aspectj-users] Detect annotated method
> >Date: Wed, 22 Mar 2006 01:00:27 +0900
> >I'm trying to write a pointcut that runs around every method that
> >has a certain annotation. For example, I'm would like to run around
> >code on this method:
> >public void m( )
> > // code....
> >but I don't wan to run around code on this other one:
> >public void n( )
> > // code....
> >I thought it was ok to do something like this:
> >Object around(): call(* *.*(..)) && !call(* *.(@MyAnnotation *)(..))
> >&& etc....
> >But AJDT points that the code has syntax errors.
> >What is the right way to acomplish what I want to do?
> >Sure I can do this filtering by using some reflection. But I want
> >programmers to see only aspect application marks only in calls in
> >which aspects are really applied. So I'm pretty convinced that that
> >should be a way to do it by writing correct pointcut code.
> >Thanks in advance.
> aspectj-users mailing list