Java:可以合并仅包含其他包的包的空子目录吗?

发布于 2024-08-29 22:58:47 字数 429 浏览 3 评论 0原文

大家下午好。

我对这里的“是”不太抱有希望,但如果有人能弄清楚的话,SO 的人也能。

我有一个具有以下包结构的 Java 项目:

src
|-net
| |-binarymuse
|   |-gwt
|     |-client
|     | |-ui
|     |   |-project
|     |     |-Project.java
|     |-Project.gwt.xml
|-overview.html

我想合并 src/ 文件夹中的空子目录,以便代替 /src/net/binarymuse/gwt/client/ui/project/ 我有 /src/net.binarymuse.gwt/client.ui.project/。这可能吗?

谢谢。

Good afternoon, all.

I'm not too hopeful for a "yes" here, but if anyone can figure it out, the folks at SO can.

I have a Java project that has the following package structure:

src
|-net
| |-binarymuse
|   |-gwt
|     |-client
|     | |-ui
|     |   |-project
|     |     |-Project.java
|     |-Project.gwt.xml
|-overview.html

I would like to consolidate the empty subdirectories in the src/ folder so that instead of /src/net/binarymuse/gwt/client/ui/project/ I'd have /src/net.binarymuse.gwt/client.ui.project/. Is this possible?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怎会甘心 2024-09-05 22:58:47

应该可以编写一个像这样工作的类加载器,甚至可以通过子类化 URLClassLoader

It should be possible to write a classloader that works like this, perhaps even by subclassing URLClassLoader.

小耗子 2024-09-05 22:58:47

您无法折叠磁盘上的目录,不,但是某些 IDE(例如 Eclipse)在显示类层次结构时会自动执行此操作

You can't collapse the directories on disk, no, but some IDEs (e.g. Eclipse) will do it automatically when they show the class hierarchy

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文