I like to put my email address within @author
tags and would like them to be clickable mailto:
links in the generated Javadoc.
How should I go about doing this correctly?
/** * I currently do the following, but would like to have my name * displayed as the link rather than the email itself. * * @author {@link "mailto:[email protected]"} */ public class Useless { }
/** * I've tried this, but get warnings about unexpexted text where my name is. * * @author {@link "mailto:[email protected]" "Benoit St-Pierre"} */ public class Useless { }
Writing Javadoc Comments In general, Javadoc comments are any multi-line comments (" /** ... */ ") that are placed before class, field, or method declarations. They must begin with a slash and two stars, and they can include special tags to describe characteristics like method parameters or return values.
Javadoc (originally cased JavaDoc) is a documentation generator created by Sun Microsystems for the Java language (now owned by Oracle Corporation) for generating API documentation in HTML format from Java source code.
The {@link}
is Javadoc-specific markup. Javadocs, though, are HTML - so you can simply use
/** * Embed HTML directly into the Javadoc. * * @author <a href="mailto:[email protected]">Benoit St-Pierre</a> */ public class Useless { }
Whether that's a good idea or not is a different matter. :-)
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