且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从 String 动态实例化类的 Groovy 方法

更新时间:2023-12-05 15:40:58

这有效,使用 底层GroovyClassLoader:

This works, using the underlying GroovyClassLoader:

def instance = this.class.classLoader.loadClass( 'Item', true, false )?.newInstance()