jeudi 9 juillet 2015

How can I get all (non-final) object vals and subobject vals using reflection in Scala?

Note: This question is not a duplicate of How can I get all object vals and subobject vals using reflection in Scala?

The answer provided in that question only works for final members.

For example:

scala> object Settings {
     |   val Host = "host"
     | }
defined module Settings

deepMembers(Settings)
res0: Map[String,String] = Map()





Aucun commentaire:

Enregistrer un commentaire