Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » how can i block calls from package to another?
how can i block calls from package to another? [message #601165] Thu, 12 August 2010 07:42 Go to next message
elhanan Maayan is currently offline elhanan Maayan
Messages: 131
Registered: November 2009
Senior Member
hi..

i would like to create a pointcut that will detected any calls that classes from package com.pnx.**.command.** to classes com.pnx.**.bo.** package, and give a compiler error. is there a way to do that?
Re: how can i block calls from package to another? [message #601175 is a reply to message #601165] Thu, 12 August 2010 16:59 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 368
Registered: July 2009
Senior Member
Yes, you want to use a declare error statement. This will give you compile time feedback and produce a compile error.

I think something like should work:

aspect A {
declare error : call(* com.pnx.**.command.**.*(..)) : "Invalid method call";
}

Or something like that.
Re: how can i block calls from package to another? [message #601180 is a reply to message #601175] Fri, 13 August 2010 07:17 Go to previous message
elhanan Maayan is currently offline elhanan Maayan
Messages: 131
Registered: November 2009
Senior Member
got it, like this:
[CODE][public aspect NoBoInsideCommands {
declare error : call(* com.pnx.**.command.**.*.*(..) ) && within(com.pnx.**.bo.**.*) : "cannot call command inside bo";
}/CODE]
Previous Topic:how can i block calls from package to another?
Next Topic:Eclipse RCP + AspectJ + Equinox + ltw
Goto Forum:
  


Current Time: Tue Jul 29 11:04:17 EDT 2014

Powered by FUDForum. Page generated in 0.02512 seconds