|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.di.core.variables.Variables
public class Variables
This class is an implementation of VariableSpace
Constructor Summary | |
---|---|
Variables()
|
Method Summary | |
---|---|
void |
copyVariablesFrom(VariableSpace space)
Copy the variables from another space, without initializing with the defaults. |
String |
environmentSubstitute(String aString)
Substitute the string using the current variable space. |
String[] |
environmentSubstitute(String[] string)
Replaces environment variables in an array of strings. |
static VariableSpace |
getADefaultVariableSpace()
Get a default variable space as a placeholder. |
boolean |
getBooleanValueOfVariable(String variableName,
boolean defaultValue)
This method returns a boolean for the new variable check boxes. |
VariableSpace |
getParentVariableSpace()
Get the parent of the variable space. |
String |
getVariable(String variableName)
Get the value of a variable. |
String |
getVariable(String variableName,
String defaultValue)
Get the value of a variable with a default in case the variable is not found. |
void |
initializeVariablesFrom(VariableSpace parent)
Initialize variable space using the defaults, copy over the variables from the parent (using copyVariablesFrom()), after this the "injected" variables should be inserted (injectVariables()). |
void |
injectVariables(Map<String,String> prop)
Inject variables. |
String[] |
listVariables()
List the variables (not the values) that are currently in the variable space. |
void |
setParentVariableSpace(VariableSpace parent)
Set the parent variable space |
void |
setVariable(String variableName,
String variableValue)
Sets a variable in the Kettle Variables list. |
void |
shareVariablesWith(VariableSpace space)
Share a variable space from another variable space. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Variables()
Method Detail |
---|
public void copyVariablesFrom(VariableSpace space)
VariableSpace
copyVariablesFrom
in interface VariableSpace
space
- the space to copy the variables from.public VariableSpace getParentVariableSpace()
VariableSpace
getParentVariableSpace
in interface VariableSpace
public void setParentVariableSpace(VariableSpace parent)
VariableSpace
setParentVariableSpace
in interface VariableSpace
parent
- The parent variable space to setpublic String getVariable(String variableName, String defaultValue)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variabledefaultValue
- The default value in case the variable could not be
found
public String getVariable(String variableName)
VariableSpace
getVariable
in interface VariableSpace
variableName
- The name of the variable
public boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
VariableSpace
getBooleanValueOfVariable
in interface VariableSpace
variableName
- The variable to look up.defaultValue
- The default value to return.
static method ValueMeta.convertStringToBoolean()
public void initializeVariablesFrom(VariableSpace parent)
VariableSpace
initializeVariablesFrom
in interface VariableSpace
parent
- the parent to start from, or null if root.public String[] listVariables()
VariableSpace
listVariables
in interface VariableSpace
public void setVariable(String variableName, String variableValue)
VariableSpace
setVariable
in interface VariableSpace
variableName
- The name of the variable to setvariableValue
- The value of the variable to set. If the
variableValue is null, the variable is cleared
from the list.public String environmentSubstitute(String aString)
VariableSpace
environmentSubstitute
in interface VariableSpace
aString
- The string to substitute.
public String[] environmentSubstitute(String[] string)
VariableSpace
environmentSubstitute
in interface VariableSpace
string
- The array of strings that wants its variables to be replaced.
public void shareVariablesWith(VariableSpace space)
VariableSpace
shareVariablesWith
in interface VariableSpace
space
- Variable space to be shared.public void injectVariables(Map<String,String> prop)
VariableSpace
injectVariables
in interface VariableSpace
prop
- Properties object containing key-value pairs.public static VariableSpace getADefaultVariableSpace()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |