blob: 7a0f855d9d9f66cd9f21ccc5bfb97ef5d0323374 [file] [log] [blame]
Stuart McCullochbb014372012-06-07 21:57:32 +00001package aQute.bnd.build;
2
3import java.lang.reflect.*;
4
5import aQute.bnd.service.action.*;
6
7public class ReflectAction implements Action {
Stuart McCulloch2286f232012-06-15 13:27:53 +00008 String what;
Stuart McCullochbb014372012-06-07 21:57:32 +00009
Stuart McCulloch2286f232012-06-15 13:27:53 +000010 public ReflectAction(String what) {
11 this.what = what;
12 }
13
14 public void execute(Project project, String action) throws Exception {
15 Method m = project.getClass().getMethod(what);
16 m.invoke(project);
17 }
18
Stuart McCulloch55d4dfe2012-08-07 10:57:21 +000019 @Override
Stuart McCulloch2286f232012-06-15 13:27:53 +000020 public String toString() {
21 return "ra:" + what;
22 }
Stuart McCullochbb014372012-06-07 21:57:32 +000023}