I want to introduce interfaces to XSD generated concrete classes. First I need to show the working version:
public interface IBooking<T extends IChargeList> {
T getChargesList();
void setChargesList(T value);
}
public aspect IntertypeDeclarationAspect {
declare parents:Booking implements IBooking<BookingChargeList>;
declare parents:BookingChargeList implements IChargeList;
}
That version works but if I move generics to method declarations it doesn't:
public interface IBooking {
<T extends IChargeList> T getChargesList();
<T extends IChargeList> void setChargesList(T value);
}
public aspect IntertypeDeclarationAspect {
declare parents:Booking implements IBooking;
declare parents:BookingChargeList implements IChargeList;
}
The error message is:
Booking.java:144 [error] The type Booking must implement the inherited abstract method IBooking.setChargesList(T)
The interesting part it doesn't give error for getChargesList()
method.
What could be the reason for that?
The related part in Booking class is like this:
public BookingChargeList getChargesList() {
return chargesList;
}
public void setChargesList(BookingChargeList value) {
this.chargesList = value;
}