java Javadoc 插入 UML 图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1411172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Javadoc Inserting UML Diagrams
提问by Mo .
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.
有没有办法将图像嵌入到我的 JavaDoc 中?基本上我想在一些文档中包含一些 UML 图来解释我的类的层次结构。
Thanks!
谢谢!
回答by Adamski
Check out this sectionof the Javadoc documentation, which explains how to embed images in your Javadoc.
查看Javadoc 文档的这一部分,它解释了如何在 Javadoc 中嵌入图像。
Also, here is an articledescribing how to reverse engineer UML diagrams and embed them in your Javadoc using UMLGraph.
回答by laalto
Yes.
是的。
The documentationexplains how to embed arbitrary images to javadoc documentation.
该文档解释了如何将任意图像嵌入到 javadoc 文档中。
If you want to generate UML class diagrams from your Java source, have a look at the UMLGraph doclet.
如果您想从 Java 源代码生成 UML 类图,请查看UMLGraph doclet。
回答by Ondra ?i?ka
This articleshows how to use UMLGraph with Maven Javadoc plugin.
本文展示了如何将 UMLGraph 与 Maven Javadoc 插件一起使用。
In short:
简而言之:
Install GraphViz.
Ubuntu:
apt-get install graphviz4.
Windows: download.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>Run
mvn javadoc:javadoc.
安装 GraphViz。
乌班图:
apt-get install graphviz4。
Windows:下载.更新 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>运行
mvn javadoc:javadoc。
回答by Sileria
Simple Answer:
简单回答:
/**
* This class does some stuff (see diagram).
* <img src="relative/path/to/image.png" />
*
*/
public class SomeClass{
}

