| org.enhydra.util.ConfigFileInterface
All known Subclasses: org.enhydra.util.AbsConfigFile,
ConfigFileInterface | public interface ConfigFileInterface (Code) | | ConfigFileInterface is used to manipulate application's configuration files.
See Also: Config version: $Revision: 1.2 $ |
Method Summary | |
public void | addEntry(String key, String[] values, String comment) Add an entry to the config file. | public void | addEntry(String key, String value, String comment) Add an entry to the config file. | public String | getComment(String key) Returns the comment associated with a given key, or null if
there is no comment. | public Config | getConfig() Returns the Config object representing the config data in the file. | public File | getFile() Gets the associated file. | public void | removeEntry(String key) Remove an entry from the config file. | public void | setFile(File file) Sets the configuration file. | public void | write() Writes this config to the associated file. | public void | write(OutputStream outputStream) Writes out a config file to the OutputStream specified. |
TRAILING_COMMENT | final public static String TRAILING_COMMENT(Code) | | The key under which the trailing comment is stored.
|
addEntry | public void addEntry(String key, String[] values, String comment) throws KeywordValueException(Code) | | Add an entry to the config file.
Parameters: key - The config element name. Parameters: values - A string array of values. Parameters: comment - A string containing a properly commented config file comment. exception: KeywordValueException - |
addEntry | public void addEntry(String key, String value, String comment) throws KeywordValueException(Code) | | Add an entry to the config file.
Parameters: key - The config element name. Parameters: value - A String value. Parameters: comment - A string containing a properly commented config file comment. exception: KeywordValueException - |
getComment | public String getComment(String key)(Code) | | Returns the comment associated with a given key, or null if
there is no comment. Pass in* ConfigFileInterface.TRAILING_COMMENT to get
the trailing comment.
Parameters: key - the key to look up. the associated comment or null |
getConfig | public Config getConfig()(Code) | | Returns the Config object representing the config data in the file.
The Config object for this ConfigFile. |
getFile | public File getFile()(Code) | | Gets the associated file. If no file is associated with this config, null
is returned.
associated file |
setFile | public void setFile(File file)(Code) | | Sets the configuration file. This method can be useful in case when in
construction of ConfigFileInterface implementation object is not defined
associated file.
Parameters: file - given reference to configuration file represented as File object. |
write | public void write(OutputStream outputStream)(Code) | | Writes out a config file to the OutputStream specified. Note that Objects
other than String or String[] will be converted into a String.
Parameters: outputStream - The output stream on which to write the config file. |
|
|