Mercurial > hg > blitz_condensed
comparison src/org/dancres/util/ReflectUtil.java @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 package org.dancres.util; | |
2 | |
3 import java.lang.reflect.Method; | |
4 | |
5 /** | |
6 Convenience methods for use with reflection | |
7 */ | |
8 public class ReflectUtil { | |
9 public static Method findMethod(Class aType, String aName, | |
10 Class[] aParameterTypes) { | |
11 | |
12 try { | |
13 return aType.getMethod(aName, aParameterTypes); | |
14 } catch (NoSuchMethodException aNSME) { | |
15 Error myError = new NoSuchMethodError("Couldn't find method"); | |
16 | |
17 // Damn, can't pass exception into constructor - why! :( | |
18 myError.initCause(aNSME); | |
19 | |
20 throw myError; | |
21 } | |
22 } | |
23 } |