Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. public static Module getModuleFromClass(Class<?> c)
  2.             throws InstantiationException, ModuleLoadException,
  3.             IllegalAccessException
  4.     {
  5.         if (!Module.class.isAssignableFrom(c))
  6.         {
  7.             throw new ModuleLoadException(
  8.                     "Passed in Class does not represent a Module.");
  9.         }
  10.         else
  11.         {
  12.             return (Module) c.newInstance();
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement