Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Declaring parents for multiple classes

Sader,

You "declare parents" statement is fine, but the other (method
introduction) statement is not.

I think you want to do something like the following:
public aspect ForceImpl {
    declare parents : org.foo..*SomeClass extends MyAbstract;
    public void MyAbstract.doSomething() {...}
}

or (to match the exact thing in your example -- you were trying
to introduce methods to *all* types in org.foo package but not 
its subpackages).

public aspect ForceImpl {
    declare parents : org.foo.* extends MySomething;
    public void MySomething.doSomething() {...}
}

-Ramnivas

--- "SADER, KEITH D (Contractor)" <KEITH.D.SADER@xxxxxxxx> wrote:
> Greetings, I'm pretty new to AspectJ and it's syntax, so please bear
> with me.
> 
> I'm trying to declare parents of every <pattern> class in my project
> to have a particular abstract class as a parent.
> 
> My aspect so far is thus:
> 
> public aspect ForceImpl {
>     declare parents : org.foo..*SomeClass extends MyAbstract;
>     public void org.foo.*.doSomething() {...}
> }
> 
> The ajc compiler complains about a syntax error on the
> ...doSomething() line.  Any ideas what I need to do to declare a
> default implementation of this method for all matching classes?
> 
> thanks,
> ---
> Keith Sader
> Nash Resources Group sub-contracting for Computer Sciences
> Corporation
> IAD:TFAS
> Tel: 816.926.3742
> Email:keith.d.sader@xxxxxxxx
> We've got a blind date with destiny, and it looks like she ordered
> the lobster.
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


Back to the top