Javadoc Inserting UML Diagrams

我是研究僧i 提交于 2019-12-02 16:18:53
Adamski

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.

laalto

Yes.

The documentation explains how to embed arbitrary images to javadoc documentation.

If you want to generate UML class diagrams from your Java source, have a look at the UMLGraph doclet.

Ondra Žižka

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.

ApiViz is a nice doclet too.

Simple Answer:

/**
 * This class does some stuff (see diagram).
 * <img src="relative/path/to/image.png" />
 * 
 */
 public class SomeClass{
 }

yDoc is an option

Vincent Ramdhanie

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!