All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.core.language.SimpleClassLoader Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.core.language;

import com.softicar.platform.common.core.utils.DevNull;

/**
 * This is the most basic implementation of {@link IClassLoader}.
 *
 * @author Oliver Richers
 */
public class SimpleClassLoader implements IClassLoader {

	private final ClassLoader classLoader;

	/**
	 * Constructs an instance of this class.
	 * 

* The class loader of this class will be used internally for class loading. */ public SimpleClassLoader() { this(SimpleClassLoader.class.getClassLoader()); } /** * Constructs an instance of this class. *

* The specified class loader will be used internally for class loading. * * @param classLoader * the actual class loader to use */ public SimpleClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } @Override public Class loadClass(String className) { try { return classLoader.loadClass(className); } catch (ClassNotFoundException exception) { throw new ClassNotFoundRuntimeException(exception); } } @Override public Class loadClass(String className, Class defaultClass) { try { return classLoader.loadClass(className); } catch (ClassNotFoundException exception) { DevNull.swallow(exception); return defaultClass; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy