Caches and returns a reference to the specified class, or throws an exception. @param name fully qualified class name @return class reference @throws ClassNotFoundException any exception or error
(final String name)
| 58 | * @throws ClassNotFoundException any exception or error |
| 59 | */ |
| 60 | public static Class<?> forName(final String name) throws ClassNotFoundException { |
| 61 | Class<?> c = CLASSES.get(name); |
| 62 | if(c == null) { |
| 63 | c = Class.forName(name); |
| 64 | if(!Modifier.isPublic(c.getModifiers())) throw new ClassNotFoundException(name); |
| 65 | CLASSES.put(name, c); |
| 66 | } |
| 67 | return c; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Caches and returns a reference to the specified field or {@code null}. |