I use YUI Compressor for years to minify and obfuscate JS files. But now I need to obfuscate and minify dynamically generated JavaScript code on the server. So the main difference here is that there will not be JS files that should be obfuscated but requests to the server (Java) which should generate portions of JS code and return them already minified and obfuscated.
YUI Compressor does not give the possibility to do that. I watched in the sources and have already figured out what methods should be overridden to make it work. I would not like to do this (but will have to in case there is no other way).
So are there any other Java libraries allowing to minify and obfuscate JavaScript strings directly from Java code?