Java异常类图?
你好,我的记忆力很差,我想打印出 Java SE 异常类的类图,把它挂在墙上或者我知道我不需要记住它,只是当你设计一个软件或准备一个软件时考试时,身边有这样的东西真是太好了。
我在 google 上搜索到的大多数图片都不完整且质量很差,所以我正在考虑将 Javadocs 转换为 UML ?然后打印出 uml 也许
有人可以帮助我吗?
Hi I have a terrible memory and I wanted to print out class diagram of Java SE Exception Classes hang it on the wall or something I know I don't need to memorize it, It's just when you're designing a software or preparing for an exam it's good to have stuff like these around you.
I've googled most of the pictures aren't complete and are bad quality, So I was thinking of converting Javadocs to UML ? then print out the uml maybe
Can someone help me please ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我也不记得全部。在 Eclipse 中,我只需使用内置功能来显示层次结构:
您可以通过使用工作集等进行过滤。这并不是你问题的答案,但这对我和迄今为止与我交谈过的每个人来说都很好。
顺便说一句:制作“层次结构”视图的屏幕截图,这就是您问题的答案:-)
I can't remember all of them, either. When in eclipse I simply use the built-in functionality to display the hierarchy:
Not really the answer to your question, but this works fine for me and everyone I've talked to so far.
BTW: Make a screenshot of the "Hierarchy" view and this is the answer to your question :-)
OpenJDK 7u3 rt.jar 的统计数据如下:
因此不可能有完整的图表。
您可能不会使用 com.sun、org.omg 或大多数 javax 的子包中的异常。
通常,您会处理某些异常子集。
我个人使用与 SJuan 相同的方法 - 在一个特定包或包子树中搜索异常。
Few statistics from OpenJDK 7u3 rt.jar:
So it's impossible to have full diagram.
Probably you will not use exceptions from subpackages of com.sun, org.omg or most of javax.
Normally you work on some subset of exceptions.
I personally use the same approach as SJuan - search for exceptions in one particular package or package subtree.
您可以将 Java 代码逆向工程为 UML 类图。它可以帮助您更好地了解现有代码。
有些工具在逆向方面非常好,特别是对于 Java。只需谷歌搜索以下单词“逆向工程java eclipse”,您就会得到您需要的东西。
You can reverse engineer your java code into an UML class diagram. It could help to have a better vision of the existing code.
some tools are pretty good in reverse specially with Java. Just google the following words "reverse engineering java eclipse" and you get what you need.
免费的 Class Visualizer 可以为您做到这一点 - 不是作为图表,而是作为层次结构树。
您可以在项目的功能页面上的屏幕截图上看到 Throwable 子树的一部分。
要获得所需的结果:将 rt.jar 加载到工具中,在层次结构视图中搜索 Throwable 并享受探索数百个异常的乐趣。
如果您的应用程序声明了一些异常,也将其加载到工具中 - 您将在层次结构中看到它们。
Free Class Visualizer can do that for you - not as a diagram, but as a hierarchy tree.
You can see part of sub-tree of Throwable on a screenshot on the project's Features page.
To get the desired result: load rt.jar into the tool, search for Throwable on the hierarchy view and enjoy exploring hundreds of exceptions.
If your application declares some exceptions, load it to the tool as well - you will see them on the hierarchy.
尝试访问官方 java 文档,从下面的页面中您可以单击任何子类,然后单击子类的子类,依此类推,直到找到您想要的内容。
http://docs.oracle.com/javase/7 /docs/api/java/lang/Exception.html
Try going to the official java documentation and from the page below you can click on any subclass, then subclass of the subclass and so on until you find what you want.
http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html