public class TypedPropertiesSource extends Object
FIXME: Extract interface
| Constructor and Description |
|---|
TypedPropertiesSource(Map<String,?> properties) |
| Modifier and Type | Method and Description |
|---|---|
static TypedPropertiesSource |
from(ConnectionParameters connectionParameters)
Converts connectionParameters to TypedPropertiesSource.
|
boolean |
getBooleanProperty(String name,
boolean defaultValue)
Parses property value as a boolean flag.
|
String |
getCharsetProperty(String name)
Parses property value as a charset encoding name.
|
Set<String> |
getKeys() |
Locale |
getLocaleProperty(String name)
Parses property value as a locale string.
|
Number |
getNumberProperty(String name,
Number defaultValue)
Returns numeric value of the property.
|
Map<String,?> |
getProperties() |
Object |
getProperty(String name)
Convenience method which returns property by name.
|
String |
getStringProperty(String name)
Returns string value of the property.
|
String |
toString() |
public Object getProperty(String name)
name - property namepublic String getStringProperty(String name)
name - property name.public Number getNumberProperty(String name, Number defaultValue) throws ConfigurationException
Accepts decimal, hexadecimal, and octal numbers if property is String.
name - property name.defaultValue - default value to use when property omitted.ConfigurationException - if parsing failed.Long.decode(String)public boolean getBooleanProperty(String name, boolean defaultValue) throws ConfigurationException
name - property name.defaultValue - default value to use if connection has no such property.ConfigurationException - if property has unrecognized value.public String getCharsetProperty(String name) throws ConfigurationException
name - property name.ConfigurationException - if charset name is unsupported.public Locale getLocaleProperty(String name)
name - property name.Locale.toString()public static TypedPropertiesSource from(ConnectionParameters connectionParameters)
connectionParameters - connection parametersCopyright © 2006-2012. All Rights Reserved.