-
Notifications
You must be signed in to change notification settings - Fork 10
Settings Class
Laurent Jourdren edited this page Apr 11, 2017
·
3 revisions
WARNING: This documentation is outdated and will soon be updated.
The Settings
object contains the global configuration of Eoulsan. Values of the Settings
object can be set with:
- Hardcoded values in the Globals class
- An Eoulsan configuration file
- The values in the global section of the parameter file
- The
setSetting(String key, String value)
method
The Javadoc of the Settings
class is available here.
For all the common settings (listed in the configuration file documentation) the Settings
define a getter and a setter. Here an example for the temporary directory or the number of local threads to use. For boolean or integer values there is no need to convert the values in string.
settings.setTempDirectory("/tmp");
settings.setTempDirectory(); // "/tmp"
settings.getLocalThreadsNumber(4);
settings.getLocalThreadsNumber(); //4
If the developer wants to use custom settings it can use the setSetting()
and getSetting()
method:
settings.setSetting("myplugin.setting1","hello");
settings.getSetting("myplugin.setting1"); // "hello"
We advise you to use the same convention for settings names that the default Eoulsan settings.
- In a
execute
method of aStep
object: Using theContext
object:
Settings settings = context.getSettings();
- From the
EoulsanRuntime
. For more information about theEoulsanRuntime
see the Eoulsan Runtime Class.
Settings settings = EoulsanRuntime.getSettings();