开发者

Java: Possible to consolidate empty subdirectories for packages that only contain other packages?

开发者 https://www.devze.com 2022-12-27 13:31 出处:网络
Good afternoon, all. I\'m not too hopeful for a \"yes\" here, but if anyone can figure it out, the folks at SO can.

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.开发者_如何学编程


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消