mercredi 22 janvier 2020

How to use reflection in Scala. I am trying to use getDeclaredMethod()

How to use reflection in Scala. My code looks like below

click here for code screenshot

val arg = new Class[_](classOf[String], classOf[String], classOf[String])
val child = Class.forName("GenerateJSON").getClassLoader.getClass.getDeclaredMethod(function_name,arg).invoke(null,matcher1.group().replace("%",""),customfield,value)

This gives me an error - Error:(28, 21) class type required but Class[_] found var arg = new Class[_](classOf[String],classOf[String],classOf[String])





Aucun commentaire:

Enregistrer un commentaire