来自给定Java代码的类图 [英] Class diagram from a given java code

查看:75
本文介绍了来自给定Java代码的类图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在java中创建一个简单的类图编辑器。该编辑器的输入是一个java文件。我已经看过很多UML类图生成器。我怎样才能创建这样的编辑器?我不知道从哪里开始?

I need to create a Simple Class Diagram Editor in java. The input to this editor is a java file. I have already seen many UML class diagram generators. How can I create such an editor? I don''t know where to start?

推荐答案

步骤:

1.使用Reflection来读取类的属性和行为。

2.将数据存储在一些tempstorage中(如地图或列表)

3.创建一个能够创建不同类型UML图的类。 >
4.创建一个负责绘制图表的编辑器类。

5.迭代列表并选择数据并将其传递给编辑器类。



这些是整体步骤,但你需要做很多事情。在开始之前画一个框架来使用。
Steps :
1. Use Reflection to read the properties & behaviour of the class.
2. Store the data in some tempstorage(like, map or list)
3. Create a class which can able to create different types UML diagram.
4. Create an Editor class which is responsible to draw the diagram.
5. Iterate the list and pick the data and pass it to Editor class.

These are overall steps , but there are lots of thing you have to do.Before start draw a framework to use.


这篇关于来自给定Java代码的类图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆