1 Clazz.declarePackage ("org.xml.sax.helpers");
2 Clazz.load (null, "org.xml.sax.helpers.NewInstance", ["java.lang.Thread", "$.UnknownError"], function () {
3 c$ = Clazz.declareType (org.xml.sax.helpers, "NewInstance");
4 c$.newInstance = Clazz.defineMethod (c$, "newInstance",
5 function (classLoader, className) {
7 if (classLoader == null) {
8 driverClass = Clazz._4Name (className);
10 driverClass = classLoader.loadClass (className);
11 }return driverClass.newInstance ();
13 c$.getClassLoader = Clazz.defineMethod (c$, "getClassLoader",
17 m = Thread.getMethod ("getContextClassLoader", null);
19 if (Clazz.exceptionOf (e, NoSuchMethodException)) {
20 return org.xml.sax.helpers.NewInstance.getClassLoader ();
26 return m.invoke (Thread.currentThread (), null);
28 if (Clazz.exceptionOf (e$$, IllegalAccessException)) {
31 throw new UnknownError (e.getMessage ());
33 } else if (Clazz.exceptionOf (e$$, java.lang.reflect.InvocationTargetException)) {
36 throw new UnknownError (e.getMessage ());