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

trip.jsr.cdi.CDILoaderOfClasses Maven / Gradle / Ivy

package trip.jsr.cdi;

@SuppressWarnings("unchecked")
abstract class CDILoaderOfClasses {

	static final String ANNOTATION_PRODUCES = "javax.enterprise.inject.Produces";

	static  Class loadClass( String className ){
		try {
			return (Class)Class.forName(className);
		} catch (final ClassNotFoundException e) {
			return null;
		}
	}

	static boolean isClassPresent( String className ){
		return loadClass(className) != null;
	}

	static  T newInstanceOf( String className, Class supertype ){
		try {
			return (T)loadClass(className).newInstance();
		} catch (InstantiationException | IllegalAccessException e) {
			return null;
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy