Created
March 11, 2009 00:54
-
-
Save jashkenas/77232 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void registerNoArgs(RegisteredMethods meth, | |
String name, Object o) { | |
Class<?> c = o.getClass(); | |
try { | |
Method method = c.getMethod(name, new Class[] {}); | |
meth.add(o, method); | |
} catch (NoSuchMethodException nsme) { | |
die("There is no " + name + "() method in the class " + | |
o.getClass().getName()); | |
} catch (Exception e) { | |
die("Could not register " + name + " + () for " + o, e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment