my JavaDoc doesn't work when I have a code example with an annotation.
Any suggestions?
/**
* <pre>
* public class Demo {
* @DemoAnnotation
* public void demoMethod() {
* }
* }
* </pre>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface DemoAnnotation {
with annotation and {@literal @} added a leading space in the output (Java 9). I went for ugly HTML entity. This does not work in {@code } block though. It seems there is no universal good way how to insert code verbatim into Javadoc without the need to escape something.– virgo47 Apr 11 '18 at 06:50