I've got the following situation:
interface MyInterface { void commonMethodA(); void commonMethodB(); void specificMethod(); } abstract class Base { void commonMethodA() {...} void commonMethodB() {...} } class Derived1 extends Base implements MyInterface { void specificMethod() {...} } class Derived2 extends Base implements MyInterface { void specificMethod() {...} } i.e. I have an interface most of whose methods will be common to all implementators. Thus, IMHO the above architecture makes sense and indeed it works.
The only problem is with Javadoc. When it parses the Derived{1,2} classes, it concludes that there are two 'commonMethodAs' (and Bs)- one in the class Base that's extended from, another in the Interface that's implemented.
Would anyone have any recommendation? How to make Javadoc realize there's only one 'commonMethodA' ?
EDIT:
Forgot to add, there's also another
class Derived3withNoSpecifics extends Base { (...) } which is NOT supposed to include specificMethod(). So making Base implement MyInterface is, sadly, not an option...
EDIT2:
Another of proposed solutions, namely splitting MyInterface into MyInterfaceCommon (as I understand, implemented by Base) and MyInterfaceSpecific (implemented by Derived{1,2}) is not going to work either, and that's because of another yet-unmentioned constraint :) : elsewhere in the program I need to be able to accept instances of both Derived1 and Derived2 as parameters to a method, and I currently do it with
void theMethod(MyInterface parameter) { (...) } This method is the whole point of the existance of the MyInterface interface actually..
Here's how the produced Javadoc page looks like:
http://distorted.org/javadoc-library/org/distorted/library/DistortedTexture.html
Notice the 'getHeight()' , 'getWidth()' and 'getID()' are repeated. You do not see the class DistortedTexture is derived from and the interface it implements because both are package-local.
abstract class Base implements MyInterface? that's more logicalspecificMethod?