Search code examples
javahtmlimageannotationsjavadoc

How to block comment or tags in document comment using Javadoc


How to block img tag or any line in Java doc. When I place the cursor on class it is showing multiple times. For feature reference I am using both img tags in doc comment(document comment). Can anybody tell me how to show only one img tag by blocking <img src="../../../../resources/images/java-basic-ASCII Table.png" /> line.

package com.java.escapesequence;

/**
 * 
 * @author udaykiranp
 * 
 * </br>
 *  <img src="../../../../resources/images/java-basic-ASCII Table.png" />
 * 
 *  <img src="{@docRoot}/../resources/images/java-basic-ASCII Table.png" />
 */
public class CharSequence {
    public static void main(String[] args) {
        System.out.println((char) 33);
        System.out.println((char)0x2B);//hexa decimal start with 0x
        System.out.println((char)056);//octa decimal start with 0
    }
}

Image when placing cursor on class:

Img tag blocking in Java doc


Solution

  • If we want to use two tags and need to block other tag / comment for feature reference in javadoc we need to use See Also using @see link.

    package com.java.escapesequence;
    
    /**
     * 
     * @author udaykiranp
     * 
     * </br>
     *
     *  <img src="{@docRoot}/../resources/images/java-basic-ASCII Table.png" />
     *  @see <a href="../../../../resources/images/java-basic-ASCII Table.png">java-basic-ASCII Table.png</a>
     */
    public class CharSequence {
        public static void main(String[] args) {
            System.out.println((char) 33);
            System.out.println((char)0x2B);//hexa decimal start with 0x
            System.out.println((char)056);//octa decimal start with 0
        }
    }
    

    Java Doc: java-basic-ASCII Table.png