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 { |
Stuart McCulloch | 2286f23 | 2012-06-15 13:27:53 +0000 | [diff] [blame^] | 8 | String what; |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 9 | |
Stuart McCulloch | 2286f23 | 2012-06-15 13:27:53 +0000 | [diff] [blame^] | 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 | } |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 22 | } |