MCPcopy Create free account
hub / github.com/mozilla/rhino / classOrNull

Method classOrNull

rhino/src/main/java/org/mozilla/javascript/Kit.java:18–27  ·  view source on GitHub ↗
(String className)

Source from the content-addressed store, hash-verified

16/** Collection of utilities */
17public class Kit {
18 public static Class<?> classOrNull(String className) {
19 try {
20 return Class.forName(className);
21 } catch (ClassNotFoundException | LinkageError | SecurityException ex) {
22 } catch (IllegalArgumentException e) {
23 // Can be thrown if name has characters that a class name
24 // can not contain
25 }
26 return null;
27 }
28
29 /** Attempt to load the class of the given name. Note that the type parameter isn't checked. */
30 public static Class<?> classOrNull(ClassLoader loader, String className) {

Callers 10

getPkgPropertyMethod · 0.95
ScriptRuntimeClass · 0.95
getGlobalMethod · 0.95
findNestedClassMethod · 0.95
buildUsingReflectionMethod · 0.95
NativeJavaObjectClass · 0.95
addContextListenerMethod · 0.95
ContextClass · 0.95
InterfaceTypeInfoClass · 0.95

Calls 1

loadClassMethod · 0.45

Tested by

no test coverage detected