Convert String to Code

前端 未结 18 692
轮回少年
轮回少年 2020-11-22 09:27

I want to know if there is any way to convert a String to Java compilable code.

I have a comparative expression saved in a database field. I want to re

18条回答
  •  渐次进展
    2020-11-22 09:56

    A simple way to get code snippets to executable byte code is with the Javassist library.

    You can possibly adapt the techniques described in http://www.ibm.com/developerworks/java/library/j-dyn0610/ to fit your needs.

提交回复
热议问题