/** * Tries to load a class based on the given name * @param name name of the class * @return loaded class or <code>null</code> if it isn't in the classpath */ public static Class tryToLoadClassForName(String name) { try { return loadClassForName(name); } catch (ClassNotFoundException e) { //do nothing - it's just a try return null; } }
/** * Tries to load a class based on the given name * @param name name of the class * @return loaded class or <code>null</code> if it isn't in the classpath */ public static Class tryToLoadClassForName(String name) { try { return loadClassForName(name); } catch (ClassNotFoundException e) { //do nothing - it's just a try return null; } }
/** * Tries to load a class based on the given name * @param name name of the class * @return loaded class or <code>null</code> if it isn't in the classpath */ public static Class tryToLoadClassForName(String name) { try { return loadClassForName(name); } catch (ClassNotFoundException e) { //do nothing - it's just a try return null; } }
/** * Creates an instance for the given class-name * @param className name of the class which should be instantiated * @return created instance * @throws ClassNotFoundException if the instantiation failed * @throws IllegalAccessException if the instantiation failed * @throws InstantiationException if the instantiation failed */ public static Object instantiateClassForName(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { return loadClassForName(className).newInstance(); }
/** * Creates an instance for the given class-name * @param className name of the class which should be instantiated * @return created instance * @throws ClassNotFoundException if the instantiation failed * @throws IllegalAccessException if the instantiation failed * @throws InstantiationException if the instantiation failed */ public static Object instantiateClassForName(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { return loadClassForName(className).newInstance(); }
/** * Creates an instance for the given class-name * @param className name of the class which should be instantiated * @return created instance * @throws ClassNotFoundException if the instantiation failed * @throws IllegalAccessException if the instantiation failed * @throws InstantiationException if the instantiation failed */ public static Object instantiateClassForName(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { return loadClassForName(className).newInstance(); }
Class<?> classOfResult = ClassUtils.loadClassForName((String) result); if (targetType.isAssignableFrom(classOfResult))
Class<?> classOfResult = ClassUtils.loadClassForName((String) result); if (targetType.isAssignableFrom(classOfResult))