@Override public Object apply(String s) { try { return Play.application().classloader().loadClass(s).newInstance(); } catch (Exception e) { throw new RuntimeException("Could not instantiate class '" + s + "'.", e); } }
private static Reflections getReflections(Application app, String packageName) { if (app.isTest()) { return ReflectionsCache$.MODULE$.getReflections(app.classloader(), packageName); } else { return new Reflections(getReflectionsConfiguration(packageName, app.classloader())); } }
/** * Load a Yaml file from the classpath. */ public static Object load(String resourceName) { return load( play.Play.application().resourceAsStream(resourceName), play.Play.application().classloader() ); }
/** * Load a Yaml file from the classpath. */ public static Object load(String resourceName) { return load( play.Play.application().resourceAsStream(resourceName), play.Play.application().classloader() ); }
private static Reflections getReflections(Application app, String packageName) { if (app.isTest()) { return ReflectionsCache$.MODULE$.getReflections(app.classloader(), packageName); } else { return new Reflections( new ConfigurationBuilder() .addUrls(ClasspathHelper.forPackage(packageName, app.classloader())) .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(packageName + "."))) .setScanners(new TypesScanner(), new TypeAnnotationsScanner())); } }
config.addClass(Class.forName(clazz, true, application.classloader())); } catch(Throwable e) { throw ebeanConf.reportError(