public class Configuration
extends java.lang.Object
Constructor and Description |
---|
Configuration(java.lang.String pFileName)
Creates a
Configuration object that loads the specified file. |
Modifier and Type | Method and Description |
---|---|
BooleanParameter |
getBooleanParameter(java.lang.String pParameter)
Returns the boolean parameter value from a configuration file as
BooleanParameter . |
ColorParameter |
getColorParameter(java.lang.String pParameter)
Returns the color parameter value from a configuration file as
ColorParameter . |
DoubleParameter |
getDoubleParameter(java.lang.String pParameter)
Returns the double parameter value from a configuration file as
DoubleParameter . |
java.lang.String |
getFileName()
Returns the file name that is used by this @code{Configuration} object.
|
IntegerParameter |
getIntegerParameter(java.lang.String pParameter)
Returns the integer parameter value from a configuration file as
IntegerParameter . |
java.lang.String |
getParameterValue(java.lang.String pParameter)
Returns the parameter value as string.
|
java.lang.String |
getParameterValueWithoutException(java.lang.String pParameter)
Returns the parameter value as string, without throwing any Exception.
|
void |
setFileName(java.lang.String pFileName)
Sets the name of the configuration file.
|
public Configuration(java.lang.String pFileName)
Configuration
object that loads the specified file.pFileName
- The file name as string.public java.lang.String getFileName()
public java.lang.String getParameterValueWithoutException(java.lang.String pParameter)
pParameter
- The key of the parameter for which the value should be returned.public java.lang.String getParameterValue(java.lang.String pParameter) throws java.lang.Exception
pParameter
- The key of the parameter for which the value should be returned.java.lang.Exception
- When the parameter value is not found or if the configuration file could not be loaded.public BooleanParameter getBooleanParameter(java.lang.String pParameter) throws java.lang.Exception
BooleanParameter
.pParameter
- The key of the parameter for which the BooleanParameter
object should be returned.BooleanParameter
.java.lang.Exception
- When the parameter value is not found, if the configuration file could not be loaded or
the value of the parameter has not the correct format.public IntegerParameter getIntegerParameter(java.lang.String pParameter) throws java.lang.Exception
IntegerParameter
.pParameter
- The key of the parameter for which the IntegerParameter
object should be returned.IntegerParameter
.java.lang.Exception
- When the parameter value is not found, if the configuration file could not be loaded or
the value of the parameter has not the correct format.public DoubleParameter getDoubleParameter(java.lang.String pParameter) throws java.lang.Exception
DoubleParameter
.pParameter
- The key of the parameter for which the DoubleParameter
object should be returned.DoubleParameter
.java.lang.Exception
- When the parameter value is not found, if the configuration file could not be loaded or
the value of the parameter has not the correct format.public ColorParameter getColorParameter(java.lang.String pParameter) throws java.lang.Exception
ColorParameter
.pParameter
- The key of the parameter for which the ColorParameter
object should be returned.ColorParameter
.java.lang.Exception
- When the parameter value is not found, if the configuration file could not be loaded or
the value of the parameter has not the correct format.public void setFileName(java.lang.String pFileName)
pFileName
- The name of the configuration file as string.