/** * @see #get(Class, String, java.util.Map) * @param klass * @param name * @param <T> * @return * @throws ConfigurationException */ public <T> T get(Class<T> klass, String name) throws ConfigurationException { return get(klass, name, null); }
@Override public void close() throws IOException { configurator.close(); } }
/** * Constructs a new configuration object with the specified configuration. * @param conf */ public Configurator(Configuration conf) throws ConfigurationException { this.conf = conf; registerProviders(); }
/** * Returns a default set of LuceneOptions. * * @return a default set of LuceneOptions */ public static LuceneOptions getDefaultOptions() { try { return new Configurator(new Configuration()).get(LuceneOptions.class, "plaintext"); } catch (ConfigurationException e) { throw new RuntimeException(e); } }
public SRBuilder(Env env, String metricName, Language language) throws ConfigurationException { this.env = env; this.language = language; this.config = env.getConfiguration(); this.srDir = new File(config.get().getString("sr.metric.path")); datasetNames = config.get().getStringList("sr.dataset.defaultsets"); // Properly resolve the default metric name. this.metricName = env.getConfigurator().resolveComponentName(SRMetric.class, metricName); if (!srDir.isDirectory()) { srDir.mkdirs(); } }
/** * Hack: Better to ask the configurator for this! * @param conf * @return */ public static SpatialDataFolder get(Configuration conf) { return new SpatialDataFolder(conf.getFile("spatial.dir")); } }
/** * Constructs an instance of the specified class with the passed * in config. This bypasses the cache and the configuration object. * * * @param klass The class being created. * @param name An arbitrary name for the object. Can be null. * @param conf The configuration for the object. * @param runtimeParams * @return The object */ public <T> T construct(Class<T> klass, String name, Config conf, Map<String, String> runtimeParams) throws ConfigurationException { return constructInternal(klass, name, conf, runtimeParams).getRight(); }
/** * Get a specific named instance of the component with the specified class. * This method can only be used when there is exactly one instance of the component. * * @param klass The generic interface or superclass, not the specific implementation. * @return The requested component. */ public <T> T get(Class<T> klass) throws ConfigurationException { return get(klass, null); }
/** * Hack: Better to ask the configurator for this! * @param conf * @return */ public static SpatialDataFolder get(Configuration conf) { return new SpatialDataFolder(conf.getFile("spatial.dir")); } }
/** * Constructs a new configuration object with the specified configuration. * @param conf */ public Configurator(Configuration conf) throws ConfigurationException { this.conf = conf; registerProviders(); }
/** * Get a specific named instance of the component with the specified class. * This method can only be used when there is exactly one instance of the component. * * @param klass The generic interface or superclass, not the specific implementation. * @return The requested component. */ public <T> T get(Class<T> klass) throws ConfigurationException { return get(klass, null); }
/** * @see #get(Class, String, java.util.Map) * @param klass * @param name * @param <T> * @return * @throws ConfigurationException */ public <T> T get(Class<T> klass, String name) throws ConfigurationException { return get(klass, name, null); }
public LanguageSet getLanguages() { try { return configurator.get(LanguageSet.class); } catch (ConfigurationException e) { throw new RuntimeException(e); } }
public WebEntityParser(Env env) throws ConfigurationException { // this.conceptDao = env.getConfigurator().get(UniversalPageDao.class); this.pageDao = env.getConfigurator().get(LocalPageDao.class); }
public ContainsPointScorer(Env env, Config conf) throws ConfigurationException { super(env, conf); wikidataDao = env.getConfigurator().get(WikidataDao.class); }
public ContainsPointScorer(Env env, Config conf) throws ConfigurationException { super(env, conf); wikidataDao = env.getConfigurator().get(WikidataDao.class); }
public LoadedStats(Env env) throws ConfigurationException { this.env = env; this.dao = env.getConfigurator().get(MetaInfoDao.class); }
public LoadedStats(Env env) throws ConfigurationException { this.env = env; this.dao = env.getConfigurator().get(MetaInfoDao.class); }
public SpatialDataLoader(Env env) throws ConfigurationException, WikiBrainException { this.env = env; this.langs = env.getLanguages(); this.spatialDao = env.getConfigurator().get(SpatialDataDao.class); this.metaDao = env.getConfigurator().get(MetaInfoDao.class); this.wdDao = env.getConfigurator().get(WikidataDao.class); }
public SpatialDataLoader(Env env) throws ConfigurationException, WikiBrainException { this.env = env; this.langs = env.getLanguages(); this.spatialDao = env.getConfigurator().get(SpatialDataDao.class); this.metaDao = env.getConfigurator().get(MetaInfoDao.class); this.wdDao = env.getConfigurator().get(WikidataDao.class); }