mardi 1 mai 2018

How to invoke method after another method?

Let's say that I have the following code:

Method myMethod = Entry.class.getDeclaredMethod("get" + criteria);
entries.get(index).getPort();

I'd like to replace the getPort method with the reflected method "myMethod". How can I invoke a reflected method after another method? (entries.get(index) in this case)

It's probably a really simple question, but I've searched everywhere and didn't really find an answer.





Aucun commentaire:

Enregistrer un commentaire