| Author |
How to disable return value as hyperlink using javadoc?
|
Jack Wanes
Greenhorn
Joined: Sep 18, 2006
Posts: 22
|
|
Hi,
I have a method that return a class as return value, but that class does not have any published methods, so this class should not be published either.
I have the following javadoc comments added:
But in generated javadoc, MySampleClass is enabled as a hyperlink that user can click on, web browser cannot display the related page since
MySampleClass is not published. I am wondering how I can disable the hyperlink so it foes not give users false impression that this class is published?
Another weird thing is, the following class return value is not displayed as hyperlink even though I use similar javadoc comments, I cannot figure out
what is playing a role to enable/disable hyperlink here:
thanks,
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
If this class is published, and this is the method's actual return type, then that return type is very much published. If you do not want "MySampleClass" to be published it cannot be the return type or parameter type of any published method. You should consider returning a published super class or interface instead.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Winston Gutkowski
Bartender
Joined: Mar 17, 2011
Posts: 4756
|
|
Jack Wanes wrote:I have a method that return a class as return value, but that class does not have any published methods, so this class should not be published either.
I'm afraid I'll go further than Rob, and question your design.
First: Returning a class suggests reflection, which is supported in Java via intrinsic classes, but not by the language.
Second: Exposing the existence of a class is not the same as exposing the API of the the class. Personally, I don't like it, but I'm a bit of a purist when it comes to this sort of stuff.
If you are trying to create a reflection-based framework, then you need to understand that it is NOT supported by the language; and therefore any form of documentation based on it.
Winston
|
Isn't it funny how there's always time and money enough to do it WRONG?
|
 |
 |
|
|
subject: How to disable return value as hyperlink using javadoc?
|
|
|