For IntelliJ IDEA,
Android Studio or Eclipse



@Override protected String rawGet(String paramName) throws ConfigurationException { try { return nameValueTable.getString(paramName); } catch(eu.excitementproject.eop.common.exception.ConfigurationException e) { throw new ConfigurationException("Failed to get parameter value. See nested exception.",e); } }
@Override public void removeModuleConfiguration(String iModuleName) throws ConfigurationException { throw new ConfigurationException("Operation removeModuleConfiguration is not supported in this implementation ("+this.getClass().getSimpleName()+")."); }
@Override public ConfigurationParams getSisterModuleConfiguration(String iModuleName) throws ConfigurationException { if (null==configurationFile) {throw new ConfigurationException("Cannot provide sister module, since configuration file is unavailable.");} return this.configurationFile.getModuleConfiguration(iModuleName); }
public LegacyConfigurationParams(KeyCaseInsensitiveHashTable<String> parametersHashTable, ConfigurationFile configurationFile, String moduleName) throws ConfigurationException { this.parametersHashTable = parametersHashTable; this.configurationFile = configurationFile; this.moduleName = moduleName; if (null==this.parametersHashTable) throw new ConfigurationException("Null KeyCaseInsensitiveHashTable was provided."); }
public InsertionTool(ConfigurationParams params) throws ConfigurationException { try { m_driver = params.get("driver"); m_url = params.get("url"); m_username = params.get("username"); m_password = params.get("password"); m_insertionBatchSize=params.getInt("insertion batch size"); } catch (ConfigurationException e) { throw new ConfigurationException("Error getting parameters for Database connection. make sure you have values for driver,url,username and password params in Database module on the configuration file you supplied", e); } }
public static ConfigurationFile loadConfigurationFile(String configurationFileName) throws ConfigurationException { try { return new ConfigurationFile(new ImplCommonConfig(new File(configurationFileName))); } catch (eu.excitementproject.eop.common.exception.ConfigurationException e) { throw new ConfigurationException("Failed to load configuration file. Please see nested exception.",e); } }
@Override public ConfigurationParams getSisterModuleConfiguration(String iModuleName) throws ConfigurationException { try { NameValueTable sisterTable = this.commonConfig.getSection(iModuleName); return new ExcitementConfigurationParams(this.commonConfig, sisterTable, iModuleName, isExpandingEnvironmentVariables(), this.configurationFileReference); } catch (eu.excitementproject.eop.common.exception.ConfigurationException e) { throw new ConfigurationException("Failed to get the require module \""+iModuleName+"\". See nested exception.",e); } }
public LinkedHashMap<String, String> getDictionary(String key) throws ConfigurationException { String value = get(key); try { DictionaryRegExp dictionaryRegExp = new DictionaryRegExp(value); dictionaryRegExp.extractDictionary(); return dictionaryRegExp.getDictionary(); } catch (DictionaryRegExpException e) { throw new ConfigurationException("Failed to extract the dictionary for parameter: "+key); } }
public boolean getBoolean(String paramName) throws ConfigurationException { String val = get(paramName); if (val == null) { throw new ConfigurationException("Missing boolean parameter: " + getModuleName() + " : " + paramName); } if (!val.equalsIgnoreCase("true") && !val.equalsIgnoreCase("false")) { throw new ConfigurationException("Invalid value: '" + val + "' for boolean parameter: '" + paramName + "' in module '" + getModuleName() + "'"); } return Boolean.parseBoolean(val); }
/** * return the ConfigurationParams that match the given module * @param iModuleName * @return the ConfigurationParams for the given module * @throws ConfigurationException if iModuleName doesn't exist in this ConfigurationFile */ public ConfigurationParams getModuleConfiguration(String iModuleName) throws ConfigurationException { if (!m_conf.containsKey(moduleName(iModuleName))) throw new ConfigurationException("Tried to retrieve a module that doesn't exist: " + moduleName(iModuleName) ); ConfigurationParams ret = m_conf.get(moduleName(iModuleName)); if(ret == null) throw new ConfigurationException("Module name " + moduleName(iModuleName) + " has no module to match"); if (expandingEnvironmentVariables) ret.setExpandingEnvironmentVariables(true); return ret; }
public CommonConfigWrapperConfigurationFile(CommonConfig commonConfig, ConfigurationFile configurationFileReference) throws ConfigurationException { this.commonConfig = commonConfig; this.configurationFileReference = configurationFileReference; // Make sure there are no duplicate sections List<String> listSectionNames = this.commonConfig.getSectionNames(); if (null==listSectionNames) {throw new ConfigurationException("The given CommonConfig has no contents (null list of sections).");} sectionNames = new LinkedHashSet<>(); for (String sectionName : listSectionNames) { if (sectionNames.contains(sectionName)) {throw new ConfigurationException("Duplicate section has been detected: "+sectionName);} sectionNames.add(sectionName); } sectionNames = Collections.unmodifiableSet(sectionNames); }
public ExcitementConfigurationParams(CommonConfig commonConfig, NameValueTable nameValueTable, String sectionName, boolean expandingEnvironmentVariables, ConfigurationFile configurationFileReference) throws ConfigurationException { super(); this.commonConfig = commonConfig; this.nameValueTable = nameValueTable; this.sectionName = sectionName; this.configurationFileReference = configurationFileReference; if (null==this.nameValueTable) throw new ConfigurationException("Null NameValueTable was provided."); this.setExpandingEnvironmentVariables(expandingEnvironmentVariables); }
public RetrievalTool(ConfigurationParams params, Set<String> extractionTypes) throws ConfigurationException { try { m_extractionTypes = extractionTypes; m_driver = params.get("driver"); m_url = params.get("url"); m_username = params.get("username"); m_password = params.get("password"); m_logger = org.apache.log4j.Logger.getLogger(RetrievalTool.class.getName()); } catch (ConfigurationException e) { throw new ConfigurationException("Error getting parameters for Database connection. make sure you have values for driver,url,username and password params in Database module on the configuration file you supplied", e); } }
private void checkForNullModuleName(String iModuleName) throws ConfigurationException { if (iModuleName == null || "".equals(iModuleName)) throw new ConfigurationException("Empty/Null module name given"); }
@Override public void addModuleConfiguration(String iModuleName) throws ConfigurationException { throw new ConfigurationException("Operation addModuleConfiguration is not supported in this implementation ("+this.getClass().getSimpleName()+")."); }