7

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.

1
  • Exceptions are thrown. Compilation errors are shown.
    – user207421
    Sep 26, 2017 at 11:53

2 Answers 2

1

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

0

Just use the fully qualified name in package-info documentation. JavaDoc will generate HTML without showing the fully qualified name (at least in 1.7), so the results should look fine. It's just more annoying to type.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.