文件名称:class转成java源码-compilib:在运行时和内存中将Java源代码编译为Class对象
文件大小:14KB
文件格式:ZIP
更新时间:2024-06-08 08:55:15
系统开源
类转成java源码相容 一个小的实用程序库,用于在运行时将Java源代码编译为* .class对象。 主要针对编写单元测试: Set< String > sources = new HashSet<> (); sources . put( " package a.b; \n " + " public interface Consts { \n " + " int A = 10; \n " + " } " ); sources . put( " package a.c; \n " + " import a.b.Consts; \n " + " public enum SomeEnum { \n " + " X(0), Y(Consts.A); \n " + " private final int value; \n " + " SomeEnum(int value) { \n " + " this.value = value; \n " + " } \n " + " } " ); Map< String , Class<?> > compiledClasses = Compilib .
【文件预览】:
compilib-master
----src()
--------test()
--------main()
----LICENSE(7KB)
----README.md(1KB)
----pom.xml(3KB)
----.gitignore(20B)