/** * Returns true only if the class could be loaded. */ public static final boolean isClassAvailable(final String clazzName, final ClassLoader cl) { try { return null != getClassImpl(clazzName, false, cl); } catch (final ClassNotFoundException e) { return false; } }
/** * Loads and returns the class or null. * @see Class#forName(java.lang.String, boolean, java.lang.ClassLoader) */ public static final Class<?> getClass(final String clazzName, final boolean initializeClazz, final ClassLoader cl) throws JogampRuntimeException { try { return getClassImpl(clazzName, initializeClazz, cl); } catch (final ClassNotFoundException e) { throw new JogampRuntimeException(clazzName + " not available", e); } }
public static final Object createInstance(final String clazzName, final Class<?>[] cstrArgTypes, final Object[] cstrArgs, final ClassLoader cl) throws JogampRuntimeException, RuntimeException { try { return createInstance(getClassImpl(clazzName, true, cl), cstrArgTypes, cstrArgs); } catch (final ClassNotFoundException ex) { throw new JogampRuntimeException(clazzName + " not available", ex); } }
/** * @throws JogampRuntimeException if the Method can not be found. */ public static final Method getMethod(final String clazzName, final String methodName, final Class<?>[] argTypes, final ClassLoader cl) throws JogampRuntimeException, RuntimeException { try { return getMethod(getClassImpl(clazzName, true, cl), methodName, argTypes); } catch (final ClassNotFoundException ex) { throw new JogampRuntimeException(clazzName + " not available", ex); } }
/** * @param initializeClazz TODO * @throws JogampRuntimeException if the constructor can not be delivered. */ public static final Constructor<?> getConstructor(final String clazzName, final Class<?>[] cstrArgTypes, final boolean initializeClazz, final ClassLoader cl) throws JogampRuntimeException { try { return getConstructor(getClassImpl(clazzName, initializeClazz, cl), cstrArgTypes); } catch (final ClassNotFoundException ex) { throw new JogampRuntimeException(clazzName + " not available", ex); } }