|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.util.ParamUtils
public class ParamUtils
Utility class for work with command-line parameters.
Constructor Summary | |
---|---|
ParamUtils()
|
Method Summary | |
---|---|
static String |
getOptionalParam(Map params,
String paramName,
String defaultValue)
Retrieves the value of an optional parameter. |
static String |
getRequiredParam(Map params,
String paramName)
Retrieves the value of a required parameter. |
static String |
getRequiredProperty(String prop)
Retrieves the value of a required system property. |
static Map |
parseCommandLine(String[] args)
Builds a collection of parameters (name-value) from a given command-line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParamUtils()
Method Detail |
---|
public static String getRequiredParam(Map params, String paramName) throws Exception
params
- collection of parametersparamName
- parameter to retrieve
Exception
- if the parameter is not found in the given collectionpublic static String getOptionalParam(Map params, String paramName, String defaultValue)
params
- collection of parametersparamName
- parameter to retrievedefaultValue
- default value
public static Map parseCommandLine(String[] args) throws Exception
args
- command-line arguments
Exception
- if a value without corresponding parameter name is encounteredpublic static String getRequiredProperty(String prop) throws Exception
prop
- system property name
Exception
- if the property is not set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |