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

play.inject.Injector Maven / Gradle / Ivy

There is a newer version: 2.6.2
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy