Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame^] | 1 | package aQute.bnd.build; |
2 | |||||
3 | import java.lang.reflect.*; | ||||
4 | |||||
5 | import aQute.bnd.service.action.*; | ||||
6 | |||||
7 | public class ReflectAction implements Action { | ||||
8 | String what; | ||||
9 | |||||
10 | 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 | |||||
19 | public String toString() { | ||||
20 | return "ra:" + what; | ||||
21 | } | ||||
22 | } |