Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Beware abstract classes of declare parents

Hi!

I´m relatively new to AOP and AspectJ, so please excuse me, if question
is too stupid...

Following Problem:
I want to do static crosscutting for all classes in a package.
More specific, I want all the classes to implement an interface
named Finalize which declares the finalize method to do something
at the end of object livetime.

For this I coded following aspect:

public aspect A {
       declare parents:
       (foo.x.y..*) implements Finalize;
}

Now, I don´t want to introduce this implementation to abstract classes.
Is there a way to make this declaring? I thought of something
like this, but (of course) it does not work:

public aspect A {
       declare parents:
       (foo.x.y..*) &&
       (!abstract foo.x.y..*) implements Finalize;
}

Regardz,
Bjoern


Back to the top