Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Created March 11, 2009 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashkenas/77232 to your computer and use it in GitHub Desktop.
Save jashkenas/77232 to your computer and use it in GitHub Desktop.
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