|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ValuesConfig
Definition of a values holder which can
save/load its set of values.
This interface extends the ValuesHolder
definition in a manner such that the following features are
provided:
save the current settings in the
"values holder" to a permanent location.load the current settings of the
"values holder" from a previously saved configuration.The following UML diagram shows how this class fits into the
ValuesHolder scheme of things:
| Field Summary |
|---|
| Fields inherited from interface com.ccg.values.ValuesHolder |
|---|
HAS_FROM, HAS_TO, HAS_TO_FROM |
| Method Summary | |
|---|---|
String[] |
getAvailable()
Get list of available configurations. |
String |
getDefaultName()
Get the default name for the ValuesConfig
implementation. |
void |
load(String name)
Attempts to load a configuration from the specified name. |
void |
remove(String name)
Remove a configuration from existance. |
void |
save(String name)
Saves the current configuration in a manner that it can be loaded in the future. |
| Methods inherited from interface com.ccg.values.ValuesHolder |
|---|
fromObject, getCapabilities, getObjectClass, toObject |
| Method Detail |
|---|
String getDefaultName()
ValuesConfig
implementation.
Sometimes, one doesn't want to worry about choosing between
available configurations for a object - they simply want to work
with the 'default' configuration - or a application may only need
one configuration. In these cases, one can simply use this method
to retrieve the name for the 'default' configuration and then use
this name with the save and load
methods.
Please note that the name returned does NOT guarantee
existance of the configuration (in other words a load of the default name might fail) - someone must save a
configuration under the default name before it can be loaded.
save and load methods.String[] getAvailable()
This method returns the "simple" names of ALL of the currently available configuration files that are available for loading.
void save(String name)
throws IOException,
ConfigException
loaded in the future.
This method attempts to permanently save the state of the "values holder" in a manner that it can be loaded in the future.
name - Name or key which configuration is to be saved under
(typically in a simple form like: "liveoak" - don't assume a
file system). Must not be null.
ConfigException - If there is a problem with the configuration
IOException - If there is a problem trying to write the configuration to its
final location.load(java.lang.String)
void load(String name)
throws IOException,
ConfigException
This method attempts to load the values back from a
configuration which had previously been saved.
name - Name or key which configuration is to be loaded (typically in
a simple form like: "liveoak" - don't assume a file
system). Must not be null.
ConfigException - If there is a problem with the configuration
IOException - If there is a problem trying to read the configuration from
the system/network.
void remove(String name)
throws IllegalArgumentException,
IOException
This method attempts to delete the configuration specified.
name - Name of the configuration to be removed - must not be null.
IllegalArgumentException - If there is a problem removing the configuration (didn't
exist, insufficient permissions, etc).
IOException - If there is a problem removing the configuration (didn't
exist, insufficient permissions, etc).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||