0

There is a possibility in AspectJ to modify the class hierarchy using declare statements :

declare parents : TypePattern extends Type;

From http://eclipse.org/aspectj/doc/released/adk15notebook/annotations-decp.html

Basically it allow you to "insert" a class in the hierarchy, here I insert X class :

 1. Child extends Parent                   -->   Child extends X extends Parent 
 2. Child extends SomeClass extends Parent -->   Child extends X extends SomeClass extends X extends Parent

However I am looking for a notation that will allow me to resolve the second case to :

 2. Child extends SomeClass extends Parent  -->   Child extends SomeClass extends X extends Parent

My problem is I have Child extends X and SomeClass extends X. Do you know AspectJ notation that would solve this problem ?

1 Answer 1

0

Does this not work?

declare parents : Child extends SomeClass;
declare parents : SomeClass extends X;
declare parents : X extends Parent;

I guess I am not exactly sure what your goal is.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.