Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consuming imports for JavaDoc in package-info.java

Tags:

java

javadoc

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.

like image 797
Max Avatar asked Nov 24 '13 04:11

Max


People also ask

How to add package-info java?

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.

What is a package-info Java file?

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.

How to create 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.


1 Answers

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...

like image 132
aliopi Avatar answered Sep 22 '22 22:09

aliopi