net.sf.jeters.configuration
Interface Configurable

All Known Implementing Classes:
AssistedComponent, AssistedConfigurable, DefaultCLI, DefaultGUI, MediaWikiIO, RegExReplacer, RegExReplacer_User

public interface Configurable

Components using this optional interface will be able to store settings. There is a more detailled explanation of the configuration concept at Configuration

Author:
Tobias Knerr

Method Summary
 Configuration getConfiguration()
          this method is called to retrieve the current configuration for this component.
 void setConfiguration(Configuration configuration)
          sets the configuration for this object.
 

Method Detail

setConfiguration

void setConfiguration(Configuration configuration)
sets the configuration for this object. The referenced configuration will not change after being passed to configurationSet. However, it is possible that setConfiguration is called again. This will not happen during execution of other component methods. Any config passed to setConfiguration is guaranteed to include at least those configuration entries that were included in a previous getConfiguration result, thus you needn't check for missing entries. The object must not rely on this method being called. Instead, it then has to work with a default configuration.

Parameters:
configuration - configuration to be used by the component; not null

getConfiguration

Configuration getConfiguration()
this method is called to retrieve the current configuration for this component. It will e.g. be used for storing changes made during component usage to the configuration file. If it is called before setConfiguration, a default configuration for this component is expected to be returned (which is used, among other things, for creating the initial config file).

Returns:
configuration currently used by the component; not null