private String getConfiguration(ConfigKey pKey) { // TODO: Use fragments and/or configuration service if available. String value = bundleContext.getProperty(CONFIG_PREFIX + "." + pKey.getKeyValue()); if (value == null) { value = pKey.getDefaultValue(); } return value; }
// Customizer for registering servlet at a HttpService private Dictionary<String, String> getConfiguration() { Dictionary<String, String> config = new Hashtable<String, String>(); for (ConfigKey key : ConfigKey.values()) { String value = getConfiguration(key); if (value != null) { config.put(key.getKeyValue(), value); } } return config; }
/** * Get a processing configuration as a boolean value * * @param pConfigKey configuration to lookup * @return boolean value of the configuration, the default value or false if the default value is * null */ public Boolean getParameterAsBool(ConfigKey pConfigKey) { String booleanS = getParameter(pConfigKey); return Boolean.parseBoolean(booleanS != null ? booleanS : pConfigKey.getDefaultValue()); }