public class ConfigurationPropertiesHandler extends Object implements ConfigurationHandler
Modifier and Type | Field and Description |
---|---|
private static char |
C_PFIX |
private static char |
C_SEP |
private HashMap |
initValues |
private HashMap |
props |
Constructor and Description |
---|
ConfigurationPropertiesHandler()
Creates a new instance of ConfigurationPropertiesLoader
|
Modifier and Type | Method and Description |
---|---|
Vector |
getCategories()
This method returns all categories.
|
HashMap |
getProperties()
This method returns all properties.
|
void |
initialize(HashMap parameters)
This method save the incoming parameters for
later use.
|
void |
load()
This is the
load method that will be
called by the ConfigurationManager . |
void |
loadProperties(File file)
This method will store all categories and properties to a
Java-properties file.
|
void |
store()
This method stores one or all categories as a properties file.
|
void |
storeProperties(File file,
HashMap data)
This method will generate a Java-properties file.
|
void |
storeProperties(File file,
String category,
Hashtable props)
This method will write a Java-properties file and fill in the properties
for the particular category.
|
private static final char C_SEP
private static final char C_PFIX
private HashMap initValues
public ConfigurationPropertiesHandler()
public void initialize(HashMap parameters)
initialize
in interface ConfigurationHandler
parameters
- a HashMap
with all parameters
as key value pairs.public void load() throws ConfigurationManagerException
load
method that will be
called by the ConfigurationManager
.load
in interface ConfigurationHandler
ConfigurationManagerException
- if some error will occurpublic void loadProperties(File file) throws ConfigurationManagerException
file
- the fileConfigurationManagerException
- if the file cannot be processedpublic HashMap getProperties()
getProperties
in interface ConfigurationHandler
HashMap
with all propertiespublic Vector getCategories()
getCategories
in interface ConfigurationHandler
Vector
with all categories as String
public void store() throws ConfigurationManagerException
ConfigurationManager
. The
actual store method it determined by the type that is
passed as parameter. If the type is single then only the
specified category is saved.store
in interface ConfigurationHandler
ConfigurationManagerException
- if the file cannot be savedpublic void storeProperties(File file, HashMap data) throws ConfigurationManagerException
data
- a HashMap
with all categories and propertiesfile
- the fileConfigurationManagerException
- if the file cannot be processedpublic void storeProperties(File file, String category, Hashtable props) throws ConfigurationManagerException
file
- the filecategory
- the category that will be savedprops
- a Hashtable
with all properties for this categoryConfigurationManagerException
- if the file cannot be processedWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses