lundi 10 septembre 2018

Getting the Value of a Method Call that is Within a String

I would like to know if there is an api available that could do something like the below.

Taking a string like so: "This is a value: className.getFoo()" and then feeding the string into the api, which would convert the string to the actual value of className.getFoo().

I realize that I can do this by parsing the String and then using the reflection api, but is there an easier way?

Thanks





Aucun commentaire:

Enregistrer un commentaire