Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Newbie questing: how to weave in static methods with a certain return type

Hi !

IIs it possible to extract the static definitions in MyClass1 and MyClass2 into an aspect ?  I know how I can weave in the implementation of an interface, but in this case I would need to weave in the return type to. Is this even possible ?

abstract class SuperClass ( 

protected static <T> T byId(final Class<T> classType, final BigDecimal id) {
..... do something and return new object of type T
}
}


class MyClass1 extends SuperClass {

static MyClass1 byId(BigDecimal id) {
SuperClass.byId(MyClass1.class, id);
}

}

class MyClass2 extends SuperClass {

static MyClass2 byId(BigDecimal id) {
SuperClass.byId(MyClass2.class, id);
}


}

Regards
  Roger






Back to the top