seb
seb

Reputation: 2311

Javadoc: link to package-info

I'm using package-info.java files in my javadoc. I'm trying to link from classes contained in a package to the package-info of the very same package. I have tried several options inspired by this Oracle document.

For example, the package is:

com.zombo.apps.api.stream

I'm inside com.orcsoftware.apps.api.stream.someClass and am writing

@see com.zombo.apps.api.stream.package-info

The link doesn't get rendered in the javadoc. How can I link to the package-info?

Upvotes: 12

Views: 4265

Answers (3)

Alexey Gavrilov
Alexey Gavrilov

Reputation: 10853

In a module application (when you have a module-info.java file in the source path) the package link should start with a module name reference. For example:

@see module/package.class#member

See chapter "References" in https://docs.oracle.com/en/java/javase/20/docs/specs/javadoc/doc-comment-spec.html

Upvotes: 0

r-uu
r-uu

Reputation: 635

For those who want to reference a package-info without using the @see tag: {@link com.zombo.apps.api.stream} also works.

Upvotes: 5

Lolo
Lolo

Reputation: 4347

If you remove the .package-info it should work nicely:

@see com.zombo.apps.api.stream

Upvotes: 15

Related Questions