You will get single result when you try to find a method by it's signature (name and parameter types list):
Method java.lang.Class.getMethod(String name, Class<?>... parameterTypes)
Let say I know parameterTypes length and all but one parameter type because I can't derive class of the parameter when it was null passed to me at runtime.
So I want to get all methods by method name and array of known parameter types. If it happens that result will be single method I'll call it otherwise I'll throw an exception.
Is there a lovely way to do that not re-implementing JDK's 'getMethod'?
Aucun commentaire:
Enregistrer un commentaire