Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » util » [javadoc | source]
org.hibernate.util
public final class: PropertiesHelper [javadoc | source]
java.lang.Object
   org.hibernate.util.PropertiesHelper
Collection of helper methods for dealing with java.util.Properties objects.
Method from org.hibernate.util.PropertiesHelper Summary:
extractPropertyValue,   getBoolean,   getBoolean,   getInt,   getInteger,   getString,   maskOut,   resolvePlaceHolder,   resolvePlaceHolders,   toMap,   toStringArray,   toStringArray
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.util.PropertiesHelper Detail:
 public static String extractPropertyValue(String propertyName,
    Properties properties) 
    Extract a property value by name from the given properties object.

    Both null and empty string are viewed as the same, and return null.

 public static boolean getBoolean(String propertyName,
    Properties properties) 
 public static boolean getBoolean(String propertyName,
    Properties properties,
    boolean defaultValue) 
    Get a property value as a boolean.

    First, the string value is extracted, and then Boolean#valueOf(String) is used to determine the correct boolean value.

 public static int getInt(String propertyName,
    Properties properties,
    int defaultValue) 
    Get a property value as an int.

    First, the string value is extracted, and then Integer#parseInt(String) is used to determine the correct int value for any non-null property values.

 public static Integer getInteger(String propertyName,
    Properties properties) 
    Get a property value as an Integer.

    First, the string value is extracted, and then Integer#valueOf(String) is used to determine the correct boolean value for any non-null property values.

 public static String getString(String propertyName,
    Properties properties,
    String defaultValue) 
    Get a property value as a string.
 public static Properties maskOut(Properties props,
    String key) 
    replace a property by a starred version
 public static String resolvePlaceHolder(String property) 
    Handles interpolation processing for a single property.
 public static  void resolvePlaceHolders(Properties properties) 
    Handles interpolation processing for all entries in a properties object.
 public static Map toMap(String propertyName,
    String delim,
    Properties properties) 
    Constructs a map from a property value.

    The exact behavior here is largely dependant upon what is passed in as the delimiter.

 public static String[] toStringArray(String stringForm,
    String delim) 
    Convert a string to an array of strings. The assumption is that the individual array elements are delimited in the source stringForm param by the delim param.
 public static String[] toStringArray(String propertyName,
    String delim,
    Properties properties) 
    Get a property value as a string array.