Methods Summary |
---|
public static int | getIntProperty(java.lang.String key, int def)Gets the implementation property indicated by the specified key or
returns the specified default value as an int.
/*
* Get the maximum number of persistent connections
* from the configuration file.
*/
String prop = getProperty(key);
if (prop == null) {
return def;
}
try {
int temp = Integer.parseInt(prop);
return temp;
} catch (NumberFormatException nfe) {
// keep the default
}
return def;
|
public static int | getNonNegativeIntProperty(java.lang.String key, int def)Gets the implementation property indicated by the specified key or
returns the specified default value as an non-zero int.
int temp = getIntProperty(key, def);
if (temp >= 0) {
return temp;
}
return def;
|
public static int | getPositiveIntProperty(java.lang.String key, int def)Gets the implementation property indicated by the specified key or
returns the specified default value as an positive int.
int temp = getIntProperty(key, def);
if (temp > 0) {
return temp;
}
return def;
|
public static java.lang.String | getProperty(java.lang.String key)Gets the implementation property indicated by the specified key.
// If key is null, then a NullPointerException is thrown.
// If key is blank, then throw a specific IllegalArgumentException
if (key.length() == 0) {
throw new IllegalArgumentException("key can't be empty");
}
return getProperty0(key);
|
private static native java.lang.String | getProperty0(java.lang.String key)native interface to the configuration parameter storage.
|
public static java.lang.String | getPropertyDefault(java.lang.String key, java.lang.String def)Gets the implementation property indicated by the specified key or
returns the specified default value.
String result = getProperty(key);
return (result != null ? result : def);
|