mardi 2 janvier 2018

How to convert Type with generics into a Class in java?

I have a method objet.

I would like to extract return Type with generics and convert it to a Class in order to pass such information into Spring PropertyResolver.

Type type = myMethod.getGenericReturnType();
Class<?> returnType = /* ??? */;
environment.getProperty(key, returnType);





Aucun commentaire:

Enregistrer un commentaire