/** * Get privileged exception action to obtain Class from given class name. * If run using security manager, the returned privileged exception action * must be invoked within a doPrivileged block. * <p> * The actual context class loader will be utilized if accessible and non-null. * Otherwise the defining class loader of the calling class will be utilized. * * @param <T> class type. * @param name class name. * @return privileged exception action to obtain the Class. * The action could throw {@link ClassNotFoundException} or return {@code null} if the class cannot be found. * @throws ClassNotFoundException when provided string contains classname of unknown class. * @see AccessController#doPrivileged(java.security.PrivilegedExceptionAction) */ public static <T> PrivilegedExceptionAction<Class<T>> classForNameWithExceptionPEA(final String name) throws ClassNotFoundException { return classForNameWithExceptionPEA(name, getContextClassLoader()); }
/** * Get privileged exception action to obtain Class from given class name. * If run using security manager, the returned privileged exception action * must be invoked within a doPrivileged block. * <p> * The actual context class loader will be utilized if accessible and non-null. * Otherwise the defining class loader of the calling class will be utilized. * * @param <T> class type. * @param name class name. * @return privileged exception action to obtain the Class. * The action could throw {@link ClassNotFoundException} or return {@code null} if the class cannot be found. * @throws ClassNotFoundException when provided string contains classname of unknown class. * @see AccessController#doPrivileged(java.security.PrivilegedExceptionAction) */ public static <T> PrivilegedExceptionAction<Class<T>> classForNameWithExceptionPEA(final String name) throws ClassNotFoundException { return classForNameWithExceptionPEA(name, getContextClassLoader()); }
if (ignoreOnClassNotFound) { try { AccessController.doPrivileged(ReflectionHelper.classForNameWithExceptionPEA(nextName, loader)); } catch (ClassNotFoundException ex) { handleClassNotFoundException();
if (ignoreOnClassNotFound) { try { AccessController.doPrivileged(ReflectionHelper.classForNameWithExceptionPEA(nextName, loader)); } catch (ClassNotFoundException ex) { handleClassNotFoundException();
AccessController.doPrivileged(ReflectionHelper.<T>classForNameWithExceptionPEA(cn, loader));
AccessController.doPrivileged(ReflectionHelper.<T>classForNameWithExceptionPEA(cn, loader));
try { t = service.cast(AccessController.doPrivileged( ReflectionHelper.classForNameWithExceptionPEA(nextName, loader)).newInstance());
try { t = service.cast(AccessController.doPrivileged( ReflectionHelper.classForNameWithExceptionPEA(nextName, loader)).newInstance());