Search code examples
javaintellij-ideajavadocdocumentation-generation

IntelliJ: Cannot Add Custom JavaDoc Tags


enter image description here enter image description here

enter image description here

What's the problem?

And how do I define pre as Precondition in the generated JavaDoc? For example, the supported tag @param is translated into

Parameters:
   .....

in the generated JavaDoc.


Solution

  • I ended up using a work-around:

    /**
     * <pre>
     * "description here"
     * <b>Precondition:</b> "precondition here"
     * </pre>
     *
     * @param x  An integer.
     * other tags...
     */
    

    The custom "Precondition" tag should print out in the same format as the other supported tags in the generated JavaDoc. Adjust as needed.