List of utility methods to do Class Exist
boolean | classExists(ClassLoader loader, String className) Check if a classloader has a classname resource. return loader.getResource(classNameToResource(className)) != null;
|
boolean | classExists(String className) class Exists final Class<?> aClass; try { aClass = Class.forName(className); } catch (ClassNotFoundException ignore) { return false; return aClass != null; |
boolean | classExists(String className) class Exists try { Class.forName(className); return true; } catch (ClassNotFoundException exception) { return false; |
boolean | classExists(String className) class Exists try { forName(className); return true; } catch (Exception e) { return false; |
boolean | classExists(String className, Object context) Checks if a certain class name exists in a certain object context's class loader. boolean canWork = false; try { canWork = Class.forName(className, false, context.getClass().getClassLoader()) != null; catch (Exception e) { return canWork; |
boolean | classExists(String implClassName) class Exists try { Class.forName(implClassName); return true; } catch (ClassNotFoundException ignored) { return false; |
boolean | classExists(String name) class Exists try { Class.forName(name); return true; } catch (Exception e) { return false; |