In groovy, wie Sie eine statische Methode einer Klasse dynamisch aufrufen?In groovy, wie Sie eine statische Methode einer Klasse dynamisch aufrufen?
void callMethod(Class c, String staticmethodname){
//what goes here to call the static method of class c?
}
Scheint nicht arbeite in der groovigen Konsole. – mfloryan
Die richtige Version wäre: c.getMethod (staticmethodname) .invoke (null); – mfloryan
korrekt. Jetzt funktioniert es in der Konsole – Bozho