Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

How to disable return value as hyperlink using javadoc?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Sheriff
Posts: 22684
128
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic