Java Utililty Methods Class Exist

List of utility methods to do Class Exist

Description

The list of methods to do Class Exist are organized into topic(s).

Method

booleanclassExists(ClassLoader loader, String className)
Check if a classloader has a classname resource.
return loader.getResource(classNameToResource(className)) != null;
booleanclassExists(String className)
class Exists
final Class<?> aClass;
try {
    aClass = Class.forName(className);
} catch (ClassNotFoundException ignore) {
    return false;
return aClass != null;
booleanclassExists(String className)
class Exists
try {
    Class.forName(className);
    return true;
} catch (ClassNotFoundException exception) {
    return false;
booleanclassExists(String className)
class Exists
try {
    forName(className);
    return true;
} catch (Exception e) {
    return false;
booleanclassExists(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;
booleanclassExists(String implClassName)
class Exists
try {
    Class.forName(implClassName);
    return true;
} catch (ClassNotFoundException ignored) {
    return false;
booleanclassExists(String name)
class Exists
try {
    Class.forName(name);
    return true;
} catch (Exception e) {
    return false;