问题
I want to easily create links to classes, methods, fields, etc. from within my Javadocs without having to type out the full expression e.g., {@link AllowAllHostnameVerifier}
.
What is the fastest way to do this in Eclipse?
回答1:
If you don't already have a Javadoc for the element you're documenting, press
Shift+Alt+J.Using the
AllowAllHostnameVerifier
example, from within the Javadoc comment where you'd like the link, use autocomplete: TypeAAHV
then Ctrl+Space.Select
{@link AllowAllHostnameVerifier}
from the list of autocomplete options by pressing ↓ then Enter.
回答2:
As an addition, you can also create links to methods by using {@link #
Ctrl+Space for methods in the current class, or by using {@link ClassName#
+ Control Space for methods in ClassName.
来源:https://stackoverflow.com/questions/9908624/how-can-i-quickly-create-javadoc-links-to-elements-in-eclipse