com.xavax.xstore
Class PersistenceProperties

Object
  extended byPersistenceProperties

public class PersistenceProperties
extends Object

PersistenceProperties encapsulates the properties needed to configure the persistence environment and provides methods to get properties.


Constructor Summary
PersistenceProperties(String filename)
          Constuct a PersistenceProperties with properties from the specified file.
 
Method Summary
 String getProperty(String name)
          Get the value of the specified property.
 String getProperty(String pkgName, String name)
          Get the value of the specified property.
 String getProperty(String pkgName, String name, String defaultValue)
          Get the value of the specified property.
 String[] getStringArray(String pkgName, String name)
          Gets a string array for the given key from this resource bundle.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceProperties

public PersistenceProperties(String filename)
                      throws PersistenceException
Constuct a PersistenceProperties with properties from the specified file.

Parameters:
filename - the name of the properties file.
Throws:
PersistenceException - if the properties file is not found or an I/O exception occurs while loading the properties.
Method Detail

getProperty

public String getProperty(String name)
Get the value of the specified property.

Parameters:
name - the fully qualified property name.
Returns:
a string containing the property value.

getProperty

public String getProperty(String pkgName,
                          String name)
Get the value of the specified property. The fully-qualified property name is the concatenation of the package name and the property name.

Parameters:
pkgName - the package name.
name - the unqualified property name.
Returns:
a string containing the property value.

getProperty

public String getProperty(String pkgName,
                          String name,
                          String defaultValue)
Get the value of the specified property. The fully-qualified property name is the concatenation of the package name and the property name. If the property is not found, the default value is returned.

Parameters:
pkgName - the package name.
name - the unqualified property name.
defaultValue - the default value for the property.
Returns:
a string containing the property value.

getStringArray

public String[] getStringArray(String pkgName,
                               String name)
Gets a string array for the given key from this resource bundle.

Parameters:
pkgName - the package name.
name - the unqualified property name.
Returns:
an array of strings.