0

I would like to make an indirect call to a java method, which name is specified in a .properties file.

How can I do that ?

1 Answers1

0
Object object = // .....
try(is = propertiesInputStream()) {
    Properties p = new Properties();
    p.load(is);
    Method m = org.springframework.util.ReflectionUtils.findMethod(object.getClass(), p.get("method"));
    Object result = org.springframework.util.ReflectionUtils.invokeMethod(m, object);
}
Stewart
  • 17,616
  • 8
  • 52
  • 80