我不确定命令行工具,但我喜欢将ObjectAid用于逆向工程到类图中:
您可以轻松地将任何类与其关系添加到ObjectAid图.它使用ucls扩展名将文件保存为XML格式.以下是一个示例:
always-add-relationships="true" generalizations="true" realizations="true"
associations="true" dependencies="true" nesting-relationships="true">
name="my.classpath.common.controllers.AuthenticationInterceptor"
project="MyProject"
file="/SpecialPath/common/controllers/AuthenticationInterceptor.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
name="my.classpath.common.domain.CompanyAssignmentLocation" project="MyProject"
file="/SpecialPath/common/domain/CompanyAssignmentLocation.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
name="my.classpath.common.domain.LocationsSpreadsheetReader" project="MyProject"
file="/SpecialPath/common/domain/LocationsSpreadsheetReader.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
project="MyProject" file="/SpecialPath/common/domain/Stock.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
project="MyProject" file="/SpecialPath/common/util/FilesUtil.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
project="MyProject" file="/SpecialPath/common/util/MyProjectUtil.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
project="MyProject" file="/SpecialPath/common/util/SpringUtil.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
name="my.classpath.common.util.MyProjectUserUtil" project="MyProject"
file="/SpecialPath/common/util/MyProjectUserUtil.java" binary="false"
corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
project="MyProject" file="/SpecialPath/common/util/UnitConversion.java"
binary="false" corner="BOTTOM_RIGHT">
initial-value="false" signature="true" accessors="true" visibility="true">
private="true" static="true" />
private="true" static="true" />
package="true" initial-value="false" signature="true" accessors="true"
visibility="true">
private="true" static="true" />
private="true" static="true" />
您也可以使用PlantUML,但是反向工程比逆向工程更好:
PlantUML有其自己独特的语法,您也可以获得源代码,但它并不像ObjectAid那么简单
这两个都作为eclipse插件,对不起,我不知道更多关于任何可能做你所要求的命令行工具.