In the JavaDoc for a package I'm documenting (specifically, within a package-info.java file), I have a number of lines that look like {@link some.really.long.module.ClassName}
, and naturally I'd like to just import ClassName and say {@link ClassName}
instead, but nothing I've tried works. Is this even possible?
I've tried putting the imports above the package declaration and JavaDoc, but that shows a syntax error. I've tried putting the imports below the package declaration and JavaDoc, but then the JavaDoc process warns Tag @link: reference not found: ClassName
.
java to an existing package: right click the package -> New -> Package; now leave the package name as is and click on the checkbox "Create package-info. java" and then create.
The package-info. java is a Java file that can be added to any Java source package. Its purpose is to provide a home for package level documentation and package level annotations. Simply create the package-info.
Creating a package-info file is fairly simple: we can create it manually or seek IDE help for generating the same. In IntelliJ IDEA, we can right-click on the package and select New-> package-info. java: Eclipse's New Java Package option allows us to generate a package-info.
You can do:
This class {@linkplain some.really.long.module.ClassName ClassName} does bla bla bla...
This will show as
This class ClassName does bla bla bla...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With