Mar
30
Cleaner CDK Code #4: inheriting JavaDoc from super classes and interfaces
When you write a class implementing an interface or extending a super class, it is often the case that the API is identical. It would be nice to inherit the JavaDoc documentation, which is possible.
Inheriting JavaDoc
Java method that overwrite a superclass method or implement an interface method, can inherit JavaDoc by including this JavaDoc for that method:
/** {@inheritDoc} */ @TestMethod("testGetMIMEType") public String getMIMEType() { return null; }The JavaDoc documentation notes that missing @param and @return values are inherited implicitly since JavaDoc 1.3, but I have never noticed this in Java6. The above explicit markup is confirmed to work.
Inheriting JavaDoc
Java method that overwrite a superclass method or implement an interface method, can inherit JavaDoc by including this JavaDoc for that method:
/** {@inheritDoc} */ @TestMethod("testGetMIMEType") public String getMIMEType() { return null; }The JavaDoc documentation notes that missing @param and @return values are inherited implicitly since JavaDoc 1.3, but I have never noticed this in Java6. The above explicit markup is confirmed to work.