Macro to separate out java classe into multiple files
My professor hands out one massive .java file, which makes development a pain. Does anyone know of a script/macro/etc. which would automatically move each class to its own Java file? I think it would have to be a bit more clever than a simple regex, sinc开发者_如何学编程e you'll need to deal with nested classes, copying the imports etc.
I'm fine with any of the (nix) shell languages, and I use emacs if there's a plugin for that.
Try Eclipse or pretty much any other Java IDE. The built-in refactoring support makes short work of moving the classes around and updating references.
Something like the Eclipse Refactoring option "Convert Member Type to Top Level"?
精彩评论