org.jconfig.handler
Class PropertiesFileHandler
java.lang.Object
|
+--org.jconfig.handler.AbstractHandler
|
+--org.jconfig.handler.PropertiesFileHandler
- All Implemented Interfaces:
- ConfigurationHandler, java.util.EventListener, FileListener
- public class PropertiesFileHandler
- extends AbstractHandler
The PropertiesFileHandler can read a java-properties file
and store all entries inside the default category (general)
with the given property name and value. It is meant to be
a helper to convert property files into the structure of jConfig.
After you have read a property you can use for example the XMLFileHandler
to save it in XML form.
- Author:
- Andreas Mecky , Terry Dye
Method Summary |
java.io.File |
getFile()
|
Configuration |
load(java.lang.String configName)
This method loads a configuration and returns it |
void |
setFile(java.io.File file)
This method sets the file that will be processed |
void |
store(Configuration configuration)
This method should store all categories and properties. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PropertiesFileHandler
public PropertiesFileHandler()
- Default constructor
PropertiesFileHandler
public PropertiesFileHandler(java.lang.String filename)
- Constructor with filename
- Parameters:
filename
-
PropertiesFileHandler
public PropertiesFileHandler(java.io.File file)
- Constructor with File
- Parameters:
file
-
setFile
public void setFile(java.io.File file)
- This method sets the file that will be processed
- Parameters:
file
- the file
load
public Configuration load(java.lang.String configName)
throws ConfigurationManagerException
- Description copied from interface:
ConfigurationHandler
- This method loads a configuration and returns it
- Throws:
ConfigurationManagerException
-
store
public void store(Configuration configuration)
throws ConfigurationManagerException
- This method should store all categories and properties.
- Throws:
ConfigurationManagerException
-
getFile
public java.io.File getFile()
- Overrides:
getFile
in class AbstractHandler
- See Also:
AbstractHandler.getFile()
Copyright © 2001-2003 Andreas Mecky, Terry Dye. All Rights Reserved.