I am trying to place a link inside a code tag in the javadoc. Below is my attempt.
/**
* This method builds XML.
* <pre>
* {@code
* <Person {@link #companyId}='1234'/>
* }
* </pre>
**/
But in the generated Javadoc, the link is absent. The string {@link #companyId}='1234'
is coming as it is.
It depends on the tag. The {@code ...}
tag interprets its content as-is, i.e. avoids any interpretation of the content as either Javadoc or HTML. It is similar for the contents of the {@link ... }
tag.
Here is a workaround:
/**
* This method builds XML.
* <pre>
* {@code <Person }{@link #companyId}{@code ='1234'/>}
* </pre>
**/
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