• Post Reply Bookmark Topic Watch Topic
  • New Topic

Javadoc, how to @link to a package, not a class within the package  RSS feed

 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to provide links to packages from within my javadocs.

{@link admin} fails

as does

{@link com.whatever.admin}

This works:

@see admin

But it is tied into the fact that the current doclets generate a base file named "package-summary.html" and will break when the doclets change.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if the label in the @link tag is optional - is it? Try
{@link com.whatever.admin admin}
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve Luke wrote:I'm not sure if the label in the @link tag is optional - is it? Try
{@link com.whatever.admin admin}


no joy.
but {@link com.whatever.admin.WonderfulClass} works great. But I don't want to link to the class, just to the package.
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the link to a link about @link. Click the link and see what it links to. I haven't read it yet. Using ctrl-f-link may give additional useful information.
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Here's the link to a link about @link. Click the link and see what it links to. I haven't read it yet. Using ctrl-f-link may give additional useful information.


What is says is: "Inserts an in-line link with visible text label that points to the documentation for the specified package, class or member name of a referenced class. "

which says that you can link to a package. But all of the examples are in the "package.class" model, and I've tried every format that I can think of to make the reference to just the package work.
 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone ever find an answer to this? I'm having the same problem right now.
 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, as a workaround, if you wanted to say something like this in your javadoc comments:


This would have the same effect:


But it's not as tidy and, imho, should not be required. (Note that NetBeans, the IDE I am using, adds a "package-info.java" file to your package, to hold your package-level javadoc, but the HTML it creates from that is written to package-summary.html.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!