|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rapidminer.tools.ParameterService
public class ParameterService
This class loads the RapidMiner property files and provides methods to access
them. It also stores the values of the properties. They are still mirrored in the
System properties for keeping compatibility but it is strongly recommended to use
this class to get access.
During init this class will try to load settings from various sources. Sources with
a higher specificy will overwrite settings with a lower. The sequence is as follows while only the first step is executed
if the ExecutionMode
forbidds file access:
rapidminer.config.dir
is set, the file rapidminerrc inside this directory will be loaded.RAPIDMINER_CONFIG_DIR
will be evaluated in the same way.rapidminer.rcfile
will be loaded if defined.
Field Summary | |
---|---|
static java.lang.String |
ENVIRONMENT_RAPIDMINER_CONFIG_DIR
|
static java.lang.String |
PROPERTY_RAPIDMINER_CONFIG_DIR
|
static java.lang.String |
PROPERTY_RAPIDMINER_SRC_ROOT
Property specifying the root directory of the RapidMiner project sources. |
static java.lang.String |
RAPIDMINER_CONFIG_FILE_NAME
|
Constructor Summary | |
---|---|
ParameterService()
|
Method Summary | |
---|---|
static boolean |
booleanValue(java.lang.String value,
boolean deflt)
Deprecated. |
static void |
copyMainUserConfigFile(VersionNumber oldVersion,
VersionNumber newVersion)
This method will copy the operating system specific config file from the RapidMiner user directory from the last version to the next. |
static void |
ensureRapidMinerHomeSet()
Tries to find the rapidminer.home directory if the property is not set and sets it. |
static java.util.Collection<java.lang.String> |
getDefinedParameterKeys()
This method will return a Collection of all keys of defined parameter types. |
static java.util.Set<ParameterType> |
getDefinedParameterTypes()
This method will return a Collection of all keys of defined parameter types. |
static java.io.File |
getGlobalConfigFile(java.lang.String fileName)
This returns the file with the given fileName from the directory denoted by first the Parameter named "rapidminer.config.dir" and if this one is not defined by the environment variable "RAPIDMINER_CONFIG_DIR". |
static java.lang.String |
getGroupKey(java.lang.String key)
This will return the group of the parameter with the given key. |
static java.io.File |
getLibraryFile(java.lang.String name)
Deprecated. |
static java.io.File |
getMainUserConfigFile()
Deprecated. |
static java.util.Collection<java.lang.String> |
getParameterKeys()
This method returns all keys of all parameters, implicit as well as defined ones. |
static ParameterType |
getParameterType(java.lang.String key)
This method returns the type of the defined parameter identified by key or null if this key is unknown. |
static java.lang.String |
getParameterValue(java.lang.String key)
This method returns the value of the given parameter or null if this parameter is unknown. |
static java.io.File |
getRapidMinerHome()
Deprecated. |
static java.io.File |
getSourceFile(java.lang.String name)
Deprecated. |
static java.io.File |
getSourceResourceFile(java.lang.String name)
Deprecated. |
static java.io.File |
getSourceRoot()
Deprecated. |
static java.io.File |
getUserConfigFile(java.lang.String name)
Deprecated. |
static java.io.File |
getUserRapidMinerDir()
Deprecated. |
static java.io.File |
getVersionedUserConfigFile(VersionNumber versionNumber,
java.lang.String name)
Deprecated. |
static void |
init()
Reads the configuration file if allowed by the ExecutionMode . |
static void |
init(java.io.InputStream operatorsXMLStream)
Deprecated. |
static void |
registerParameter(ParameterType type)
This method lets register the given ParameterType with defaults
settings. |
static void |
registerParameter(ParameterType type,
java.lang.String group)
This method allows to set the group explicitly rather than deriving it from the key. |
static void |
registerParameter(ParameterType type,
java.lang.String group,
ParameterScope scope)
This method can be used to register the given ParameterType on the given
ParameterScope . |
static void |
registerParameterChangeListener(ParameterChangeListener listener)
This will add the given listener to the list of listers. |
static void |
removeParameterChangeListener(ParameterChangeListener listener)
This method will remove the given listener from the list. |
static void |
saveParameters()
This method will save all currently known defined parameter types into the version and os dependent config file in the user's RapidMiner directory. |
static void |
saveParameters(java.io.File configFile)
This method will save all currently known defined parameters into the given file. |
static void |
setParameters(java.io.File file)
This sets the parameters to the values given by a properties file denoted by the given file object. |
static void |
setParameters(java.io.InputStream in)
This method reads the input stream that streams in a properties file and sets the parameter values accordingly. |
static void |
setParameterValue(ParameterType type,
java.lang.String value)
This method sets the given parameter to the given value. |
static void |
setParameterValue(java.lang.String key,
java.lang.String value)
This method sets the parameter with the given key to the given value. |
static void |
writeProperties(java.util.Properties properties,
java.io.File file)
Deprecated. |
static void |
writePropertyIntoMainUserConfigFile(java.lang.String key,
java.lang.String value)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RAPIDMINER_CONFIG_FILE_NAME
public static final java.lang.String PROPERTY_RAPIDMINER_SRC_ROOT
public static final java.lang.String PROPERTY_RAPIDMINER_CONFIG_DIR
public static final java.lang.String ENVIRONMENT_RAPIDMINER_CONFIG_DIR
Constructor Detail |
---|
public ParameterService()
Method Detail |
---|
public static void init()
ExecutionMode
.
public static void setParameterValue(ParameterType type, java.lang.String value)
public static void setParameterValue(java.lang.String key, java.lang.String value)
public static java.lang.String getParameterValue(java.lang.String key)
public static java.lang.String getGroupKey(java.lang.String key)
public static ParameterType getParameterType(java.lang.String key)
public static java.util.Collection<java.lang.String> getParameterKeys()
public static java.util.Collection<java.lang.String> getDefinedParameterKeys()
public static java.util.Set<ParameterType> getDefinedParameterTypes()
public static void setParameters(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.IOException
java.io.FileNotFoundException
public static void setParameters(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.io.File getGlobalConfigFile(java.lang.String fileName)
public static void copyMainUserConfigFile(VersionNumber oldVersion, VersionNumber newVersion)
public static void saveParameters()
public static void saveParameters(java.io.File configFile)
saveParameters()
, no preStartParameter
files are written.
public static void registerParameter(ParameterType type)
ParameterType
with defaults
settings. To have more control over the scope and group name refer to
any other registerParameter method.
If a implicite Parameter is already defined with the key, it will be converted to an explict
without loosing the data.
public static void registerParameter(ParameterType type, java.lang.String group)
public static void registerParameter(ParameterType type, java.lang.String group, ParameterScope scope)
ParameterType
on the given
ParameterScope
. This method can be used to define for example preStartParameters
like memory size...
public static void ensureRapidMinerHomeSet()
public static void registerParameterChangeListener(ParameterChangeListener listener)
public static void removeParameterChangeListener(ParameterChangeListener listener)
@Deprecated public static void writeProperties(java.util.Properties properties, java.io.File file)
#saveProperties(File))
.
To save the given properties you can simply call Properties.store(java.io.OutputStream, String)
yourself.
@Deprecated public static void writePropertyIntoMainUserConfigFile(java.lang.String key, java.lang.String value)
setParameterValue(String, String)
and saveParameters()
.
@Deprecated public static java.io.File getMainUserConfigFile()
FileSystemService.getMainUserConfigFile()
instead.
@Deprecated public static java.io.File getUserConfigFile(java.lang.String name)
FileSystemService.getUserConfigFile(String)
instead.
@Deprecated public static java.io.File getVersionedUserConfigFile(VersionNumber versionNumber, java.lang.String name)
FileSystemService.getVersionedUserConfigFile(VersionNumber, String)
instead.
@Deprecated public static java.io.File getUserRapidMinerDir()
FileSystemService.getUserRapidMinerDir()
instead.
@Deprecated public static java.io.File getRapidMinerHome() throws java.io.IOException
FileSystemService.getRapidMinerHome()
instead.
java.io.IOException
@Deprecated public static java.io.File getLibraryFile(java.lang.String name) throws java.io.IOException
FileSystemService.getLibraryFile(String)
instead.
java.io.IOException
@Deprecated public static java.io.File getSourceRoot()
FileSystemService.getSourceRoot()
instead.
@Deprecated public static java.io.File getSourceFile(java.lang.String name)
FileSystemService.getSourceFile(String)
instead.
@Deprecated public static java.io.File getSourceResourceFile(java.lang.String name)
FileSystemService.getSourceResourceFile(String)
instead.
@Deprecated public static void init(java.io.InputStream operatorsXMLStream)
init()
instead.
@Deprecated public static boolean booleanValue(java.lang.String value, boolean deflt)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |