Javadoc Inserting UML Diagrams

后端 未结 7 1586
南笙
南笙 2021-01-30 23:20

Is there a way to embed images into my JavaDoc? Basically i want to include some UML diagrams explaining the hierarchy of my classes in some of the documentation.

Thank

相关标签:
7条回答
  • 2021-01-30 23:22

    Simple Answer:

    /**
     * This class does some stuff (see diagram).
     * <img src="relative/path/to/image.png" />
     * 
     */
     public class SomeClass{
     }
    
    0 讨论(0)
  • 2021-01-30 23:23

    yDoc is an option

    0 讨论(0)
  • 2021-01-30 23:26

    Check out this section of the Javadoc documentation, which explains how to embed images in your Javadoc.

    Also, here is an article describing how to reverse engineer UML diagrams and embed them in your Javadoc using UMLGraph.

    0 讨论(0)
  • 2021-01-30 23:26

    This article shows how to use UMLGraph with Maven Javadoc plugin.

    In short:

    1. Install GraphViz.

      Ubuntu: apt-get install graphviz4.
      Windows: download.

    2. Update pom.xml.

          <plugin>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>2.7</version>
              <configuration>
                  <aggregate>true</aggregate>
                  <show>private</show>
                  <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
                  <docletArtifact>
                      <groupId>org.umlgraph</groupId>
                      <artifactId>doclet</artifactId>
                      <version>5.1</version>
                  </docletArtifact>
                  <additionalparam>
                      -inferrel -attributes -types -visibility -inferdep -quiet -hide java.* -collpackages java.util.* -qualify -postfixpackage
                      -nodefontsize 9
                      -nodefontpackagesize 7
                  </additionalparam>
              </configuration>
          </plugin>
      
    3. Run mvn javadoc:javadoc.

    0 讨论(0)
  • 2021-01-30 23:39

    This article explains how it can be done by placing your images in a folder accessible to the javadoc tool.

    0 讨论(0)
  • 2021-01-30 23:42

    ApiViz is a nice doclet too.

    0 讨论(0)
提交回复
热议问题