play.inject.Injector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
RePlay is a fork of the Play1 framework, created by Codeborne.
package play.inject;
public class Injector {
private static BeanSource beanSource = new DefaultBeanSource();
public static void setBeanSource(BeanSource beanSource) {
Injector.beanSource = beanSource;
}
@Deprecated
public static T getBeanOfType(String className) {
try {
return getBeanOfType((Class) Class.forName(className));
} catch (ClassNotFoundException e) {
throw new RuntimeException("Cannot instantiate " + className, e);
}
}
public static T getBeanOfType(Class clazz) {
return beanSource.getBeanOfType(clazz);
}
}