本文整理匯總了Java中org.pentaho.di.trans.step.StepMetaInterface.getUsedArguments方法的典型用法代碼示例。如果您正苦於以下問題:Java StepMetaInterface.getUsedArguments方法的具體用法?Java StepMetaInterface.getUsedArguments怎麽用?Java StepMetaInterface.getUsedArguments使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.trans.step.StepMetaInterface
的用法示例。
在下文中一共展示了StepMetaInterface.getUsedArguments方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getUsedArguments
import org.pentaho.di.trans.step.StepMetaInterface; //導入方法依賴的package包/類
/**
* Get the arguments used by this transformation.
*
* @param arguments
* @return A row with the used arguments in it.
*/
public Map<String, String> getUsedArguments(String[] arguments)
{
Map<String, String> transArgs = new HashMap<String, String>();
for (int i = 0; i < nrSteps(); i++)
{
StepMetaInterface smi = getStep(i).getStepMetaInterface();
Map<String, String> stepArgs = smi.getUsedArguments(); // Get the command line arguments that this step uses.
if (stepArgs != null)
{
transArgs.putAll(stepArgs);
}
}
// OK, so perhaps, we can use the arguments from a previous execution?
String[] saved = Props.isInitialized() ? Props.getInstance().getLastArguments() : null;
// Set the default values on it...
// Also change the name to "Argument 1" .. "Argument 10"
//
for (String argument : transArgs.keySet())
{
String value = "";
int argNr = Const.toInt(argument, -1);
if (arguments!=null && argNr > 0 && argNr <= arguments.length)
{
value = Const.NVL(arguments[argNr-1], "");
}
if (value.length()==0) // try the saved option...
{
if (argNr > 0 && argNr < saved.length && saved[argNr] != null)
{
value = saved[argNr-1];
}
}
transArgs.put(argument, value);
}
return transArgs;
}