Java Class Load loadClassOrReturnNull(ClassLoader loader, String className)

Here you can find the source of loadClassOrReturnNull(ClassLoader loader, String className)

Description

load Class Or Return Null

License

Apache License

Declaration

public static Class<?> loadClassOrReturnNull(ClassLoader loader, String className) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static Class<?> loadClassOrReturnNull(ClassLoader loader, String className) {
        if (loader == null) {
            loader = ClassLoader.getSystemClassLoader();
        }// w  w w .j av a 2s .c  o m
        try {
            return loader.loadClass(className);
        } catch (ClassNotFoundException e) {
            return null;
        }
    }
}

Related

  1. loadClassByName(String className)
  2. loadClassElseThrow(final String enumType)
  3. loadClassFromClassLoader( String fillyQualifiedClassName)
  4. loadClassFromContextClassLoader(String theClassName)
  5. loadClassOrNull(String className)
  6. loadClassReflectively(ClassLoader classLoader, String fullyQualifiedClassName)
  7. loadClassSafe(final String klassName)
  8. loadClassSilently(ClassLoader cl, String name)
  9. loadClassUsingClass(Class clazz, String name)