public PropertiesReader() { try { RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); } catch (MissingResourceException e){ throw new java.util.MissingResourceException(e.getMessage(), e.getClassName(), e.getKey()); } }
+ mre.getKey() + "\n\t" + "[Class Name: "
+ mre.getKey() + "\n\t" + "[Class Name: "
public long getLong(String key, long defaultValue) { try { String value = getString(key); return (isDefined(value) ? Long.parseLong(value) : defaultValue); } catch (MissingResourceException ex) { if (isDefined(ex.getKey())) { return defaultValue; } throw ex; } }
public float getFloat(String key, float defaultValue) { try { String value = getString(key); return (isDefined(value) ? Float.parseFloat(value) : defaultValue); } catch (MissingResourceException ex) { if (isDefined(ex.getKey())) { return defaultValue; } throw ex; } }
public int getInteger(String key, int defaultValue) { try { String value = getString(key); return (isDefined(value) ? Integer.parseInt(value) : defaultValue); } catch (MissingResourceException ex) { if (isDefined(ex.getKey())) { return defaultValue; } throw ex; } }
message = errors.getString( MISSING_ERROR_KEY.getErrorKey() + ":" + e.getKey() );
public boolean getBoolean(String key, boolean defaultValue) { try { String value = getString(key); return (isDefined(value) ? asBoolean(value) : defaultValue); } catch (MissingResourceException ex) { if (isDefined(ex.getKey())) { return defaultValue; } throw ex; } }
/** * Gets the value as a String of the data identified by the specified key. If the data isn't * valued or if it doesn't exist, then the default value is returned. * <p> * If you expect the data can be not defined in this bundle, then use this method instead of * {@code org.silverpeas.core.util.SettingBundle#getString} method and use the default value * to test afterward the data is or not defined. * @param key the unique name of the data in this bundle. * @param defaultValue the default value to use if the setting is'nt valued or if it isn't * defined in the bundle. * @return the value of the data as a string of characters. * @throws MissingResourceException if the bundle doesn't exist. */ public String getString(String key, String defaultValue) { try { String value = getString(key); return (isDefined(value) ? value : defaultValue); } catch (MissingResourceException ex) { if (isDefined(ex.getKey())) { return defaultValue; } throw ex; } }
this.mre.getMessage(), this.mre.getClassName(), this.mre.getKey());