org.weblab_project.core.properties
Class PropertiesLoader

java.lang.Object
  extended by org.weblab_project.core.properties.PropertiesLoader

public final class PropertiesLoader
extends java.lang.Object

Useful class to be used for retrieving configuration files, and their properties.


Method Summary
static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename)
          Same as loadProperties(filename, PropertiesLoader.class);
static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename, java.lang.Class<?> clazz)
          Loads properties into a map from a properties file defined by filename every properties found.
static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename, java.util.Set<java.lang.String> propertiesKeys)
          Same as loadProperties(filename, propertiesKeys, PropertiesLoader.class);
static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename, java.util.Set<java.lang.String> propertiesKeys, java.lang.Class<?> clazz)
          Loads properties into a map from a properties file defined by filename and a set of property names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadProperties

public static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename,
                                                                              java.util.Set<java.lang.String> propertiesKeys,
                                                                              java.lang.Class<?> clazz)
Loads properties into a map from a properties file defined by filename and a set of property names.

Parameters:
filename - The name of the properties file to load.
propertiesKeys - The string id of the properties to load.
clazz - The class to be used to get the class loader.
Returns:
The map of properties and their values.
WARNING:
If there is more than one properties file.

loadProperties

public static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename,
                                                                              java.lang.Class<?> clazz)
Loads properties into a map from a properties file defined by filename every properties found.

Parameters:
filename - The name of the properties file to load.
clazz - The class to be used to get the class loader.
Returns:
The map of properties and their values.

loadProperties

public static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename,
                                                                              java.util.Set<java.lang.String> propertiesKeys)
Same as loadProperties(filename, propertiesKeys, PropertiesLoader.class);

Parameters:
filename - The name of the properties file to load.
propertiesKeys - The string id of the properties to load.
Returns:
Properties values mapped by keys
See Also:
loadProperties(String, Set, Class)

loadProperties

public static java.util.Map<java.lang.String,java.lang.String> loadProperties(java.lang.String filename)
Same as loadProperties(filename, PropertiesLoader.class);

Parameters:
filename - The name of the properties file to load.
Returns:
Properties values mapped by keys
See Also:
loadProperties(String, Set, Class)


Copyright © 2004-2010. All Rights Reserved.