实际上,有一个库可以做到这一点:
Jodd MethRef-强类型方法名称引用
https://jodd.org/ref/methref.html
Methref<Str> m = Methref.on(Str.class); // create Methref tool// example #1m.to().boo();m.ref(); // returns String: 'boo'

实际上,有一个库可以做到这一点:
Jodd MethRef-强类型方法名称引用
https://jodd.org/ref/methref.html
Methref<Str> m = Methref.on(Str.class); // create Methref tool// example #1m.to().boo();m.ref(); // returns String: 'boo'