-
-
Notifications
You must be signed in to change notification settings - Fork 1
Q & A
Sam Cao edited this page Jun 30, 2023
·
8 revisions
- I want to code with JDK 17 but support JDK 8/11. Jaspiler can help transform the code from JDK 17 to JDK 8/11.
- I want to remove some proprietary cloud features at source code level before deploying the binaries to an on-premise environment to prevent the reverse engineering. Jaspiler can help add/update/remove any part of the code at the AST level.
- I want to translate the Java code to JavaScript/Python/Go/.... Jaspiler can provide the complete AST and allow all kinds of translation.
- I want to obfuscate the code. Jaspiler can help perform all kinds of code obfuscation at the AST level.
Jaspiler is at its early stage with limited feature set. You are welcome taking a try. Jaspiler is expected to be a community driven open-source project, so if you want a feature, either you raise an issue, wait for the community to prioritize it, or you submit a pull request.
Jaspiler jar file an all-in-one jar file with all the dependencies. It is large because it embeds Javet (30+MB) to provide the Node.js runtime environment.
Just call jaspiler.transformSync(..., { ast: true, ... })
with ast: true
, without plugins
, and Jaspiler will skip the transformation and return the AST.
Please visit Parse argv
-
Comments Might be Lost - The JDK
JavaCompiler
separates theDocScanner
andTreeScanner
so that the comments between 2 AST trees are lost. Luckily the comments are still preserved in the parent AST trees. So, if the parent trees are not changed during the transformation, the comments do get preserved. Otherwise, the comments are lost.