Instantiate class from string

Re: reflection on this forum:

@GoToLoop has spent quite a bit of time on reflection in Processing.


The Processing API uses a related technique, a string as a method name (rather than a class name) in, for example, selectFolder – internally it calls selectMethod, which uses .getMethod() to turn the text String callbackMethod argument given to selectFolder into the corresponding Processing function (Method selectMethod) for the callback.

1 Like