|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.util.PropertiesHelper
public final class PropertiesHelper
Collection of helper methods for dealing with Properties
objects.
Method Summary | |
---|---|
static java.lang.String |
extractPropertyValue(java.lang.String propertyName,
java.util.Properties properties)
Extract a property value by name from the given properties object. |
static boolean |
getBoolean(java.lang.String propertyName,
java.util.Properties properties)
Get a property value as a boolean. |
static boolean |
getBoolean(java.lang.String propertyName,
java.util.Properties properties,
boolean defaultValue)
Get a property value as a boolean. |
static int |
getInt(java.lang.String propertyName,
java.util.Properties properties,
int defaultValue)
Get a property value as an int. |
static java.lang.Integer |
getInteger(java.lang.String propertyName,
java.util.Properties properties)
Get a property value as an Integer. |
static java.lang.String |
getString(java.lang.String propertyName,
java.util.Properties properties,
java.lang.String defaultValue)
Get a property value as a string. |
static java.util.Properties |
maskOut(java.util.Properties props,
java.lang.String key)
replace a property by a starred version |
static java.lang.String |
resolvePlaceHolder(java.lang.String property)
Handles interpolation processing for a single property. |
static void |
resolvePlaceHolders(java.util.Properties properties)
Handles interpolation processing for all entries in a properties object. |
static java.util.Map |
toMap(java.lang.String propertyName,
java.lang.String delim,
java.util.Properties properties)
Constructs a map from a property value. |
static java.lang.String[] |
toStringArray(java.lang.String stringForm,
java.lang.String delim)
Convert a string to an array of strings. |
static java.lang.String[] |
toStringArray(java.lang.String propertyName,
java.lang.String delim,
java.util.Properties properties)
Get a property value as a string array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getString(java.lang.String propertyName, java.util.Properties properties, java.lang.String defaultValue)
propertyName
- The name of the property for which to retrieve valueproperties
- The properties objectdefaultValue
- The default property value to use.
extractPropertyValue(String, java.util.Properties)
public static java.lang.String extractPropertyValue(java.lang.String propertyName, java.util.Properties properties)
propertyName
- The name of the property for which to extract valueproperties
- The properties object
public static boolean getBoolean(java.lang.String propertyName, java.util.Properties properties)
getBoolean(String, java.util.Properties, boolean)
with false
as the default value.
propertyName
- The name of the property for which to retrieve valueproperties
- The properties object
public static boolean getBoolean(java.lang.String propertyName, java.util.Properties properties, boolean defaultValue)
Boolean.valueOf(String)
is
used to determine the correct boolean value.
propertyName
- The name of the property for which to retrieve valueproperties
- The properties objectdefaultValue
- The default property value to use.
extractPropertyValue(String, java.util.Properties)
public static int getInt(java.lang.String propertyName, java.util.Properties properties, int defaultValue)
Integer.parseInt(String)
is
used to determine the correct int value for any non-null property values.
propertyName
- The name of the property for which to retrieve valueproperties
- The properties objectdefaultValue
- The default property value to use.
extractPropertyValue(String, java.util.Properties)
public static java.lang.Integer getInteger(java.lang.String propertyName, java.util.Properties properties)
Integer.valueOf(String)
is
used to determine the correct boolean value for any non-null property values.
propertyName
- The name of the property for which to retrieve valueproperties
- The properties object
extractPropertyValue(String, java.util.Properties)
public static java.util.Map toMap(java.lang.String propertyName, java.lang.String delim, java.util.Properties properties)
propertyName
- The name of the property for which to retrieve valuedelim
- The string defining tokens used as both entry and key/value delimiters.properties
- The properties object
extractPropertyValue(String, java.util.Properties)
public static java.lang.String[] toStringArray(java.lang.String propertyName, java.lang.String delim, java.util.Properties properties)
propertyName
- The name of the property for which to retrieve valuedelim
- The delimiter used to separate individual array elements.properties
- The properties object
extractPropertyValue(String, java.util.Properties)
,
toStringArray(String, String)
public static java.lang.String[] toStringArray(java.lang.String stringForm, java.lang.String delim)
stringForm
- The string form of the string array.delim
- The delimiter used to separate individual array elements.
public static java.util.Properties maskOut(java.util.Properties props, java.lang.String key)
props
- properties to checkkey
- proeprty to mask
public static void resolvePlaceHolders(java.util.Properties properties)
properties
- The properties object.public static java.lang.String resolvePlaceHolder(java.lang.String property)
property
- The property value to be processed for interpolation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |