org.pentaho.di.core.parameters
Class NamedParamsDefault

java.lang.Object
  extended by org.pentaho.di.core.parameters.NamedParamsDefault
All Implemented Interfaces:
NamedParams

public class NamedParamsDefault
extends Object
implements NamedParams

This class is an implementation of NamedParams.

Author:
Sven Boden

Constructor Summary
NamedParamsDefault()
          Default constructor.
 
Method Summary
 void activateParameters()
          Activate the currently set parameters
 void addParameterDefinition(String key, String defValue, String description)
          Add a parameter definition to this set.
 void clearParameters()
          Clear all parameters
 void copyParametersFrom(NamedParams aParam)
          Copy params to these named parameters (clearing out first).
 void eraseParameters()
          Clear the values.
 String getParameterDefault(String key)
          Get the default value of a parameter.
 String getParameterDescription(String key)
          Get the description of a parameter.
 String getParameterValue(String key)
          Get the value of a parameter.
 String[] listParameters()
          List the parameters.
 void setParameterValue(String key, String value)
          Set the value of a parameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedParamsDefault

public NamedParamsDefault()
Default constructor.

Method Detail

addParameterDefinition

public void addParameterDefinition(String key,
                                   String defValue,
                                   String description)
                            throws DuplicateParamException
Description copied from interface: NamedParams
Add a parameter definition to this set. TODO: default, throw exception

Specified by:
addParameterDefinition in interface NamedParams
Parameters:
key - Name of the parameter.
defValue - default value.
description - Description of the parameter.
Throws:
DuplicateParamException - Upon duplicate parameter definitions

getParameterDescription

public String getParameterDescription(String key)
                               throws UnknownParamException
Description copied from interface: NamedParams
Get the description of a parameter.

Specified by:
getParameterDescription in interface NamedParams
Parameters:
key - Key to get value for.
Returns:
description of parameter key.
Throws:
UnknownParamException - Parameter 'key' is unknown.

getParameterValue

public String getParameterValue(String key)
                         throws UnknownParamException
Description copied from interface: NamedParams
Get the value of a parameter.

Specified by:
getParameterValue in interface NamedParams
Parameters:
key - Key to get value for.
Returns:
value of parameter key.
Throws:
UnknownParamException - Parameter 'key' is unknown.

getParameterDefault

public String getParameterDefault(String key)
                           throws UnknownParamException
Description copied from interface: NamedParams
Get the default value of a parameter.

Specified by:
getParameterDefault in interface NamedParams
Parameters:
key - Key to get value for.
Returns:
default value for parameter key.
Throws:
UnknownParamException - Parameter 'key' is unknown.

listParameters

public String[] listParameters()
Description copied from interface: NamedParams
List the parameters.

Specified by:
listParameters in interface NamedParams
Returns:
Array of parameters.

setParameterValue

public void setParameterValue(String key,
                              String value)
Description copied from interface: NamedParams
Set the value of a parameter.

Specified by:
setParameterValue in interface NamedParams
Parameters:
key - key to set value of
value - value to set it to.

eraseParameters

public void eraseParameters()
Description copied from interface: NamedParams
Clear the values.

Specified by:
eraseParameters in interface NamedParams

clearParameters

public void clearParameters()
Description copied from interface: NamedParams
Clear all parameters

Specified by:
clearParameters in interface NamedParams

activateParameters

public void activateParameters()
Description copied from interface: NamedParams
Activate the currently set parameters

Specified by:
activateParameters in interface NamedParams

copyParametersFrom

public void copyParametersFrom(NamedParams aParam)
Description copied from interface: NamedParams
Copy params to these named parameters (clearing out first).

Specified by:
copyParametersFrom in interface NamedParams
Parameters:
aParam - the parameters to copy from.