Package nablarch.fw.launcher
Class CommandLine
java.lang.Object
nablarch.fw.launcher.CommandLine
コマンドラインオプション、コマンドライン引数をパースして格納するクラス。
- Author:
- Iwauo Tajima
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandLine(String... commandline) デフォルトコンストラクタ 与えられたコマンドライン文字列をCommandLineParserで解析し保持する。テスト用に使用するコンストラクタ。 -
Method Summary
Modifier and TypeMethodDescriptiongetArgs()コマンドライン引数のリストを返す。リクエストパラメータを取得する。リクエストパラメータのMapを取得する。リクエストパスを取得する。setParamMap(Map<String, String> opts) コマンドラインオプションのMapを設定する。setRequestPath(String requestPath) リクエストパスを設定する。
-
Constructor Details
-
CommandLine
デフォルトコンストラクタ 与えられたコマンドライン文字列をCommandLineParserで解析し保持する。- Parameters:
commandline- コマンドライン文字列
-
CommandLine
テスト用に使用するコンストラクタ。- Parameters:
opts- コマンドラインオプションのMapargs- コマンドラインオプションのList
-
-
Method Details
-
getRequestPath
リクエストパスを取得する。 リクエストパスを返す。 デフォルトでは実行されたコマンドのフルパス文字列を返す。- Specified by:
getRequestPathin interfaceRequest<String>- Returns:
- リクエストパス
-
setRequestPath
Description copied from interface:Requestリクエストパスを設定する。- Specified by:
setRequestPathin interfaceRequest<String>- Parameters:
requestPath- リクエストパス- Returns:
- オブジェクト自体
-
getParam
リクエストパラメータを取得する。 コマンドラインオプションの値を返す。 値が指定されていない場合は空文字を返す。例 -requestPath test.SampleAction/BC001 --> "test.SampleAction/BC001"を返す。 -server --> ""を返す。
-
getParamMap
リクエストパラメータのMapを取得する。 コマンドラインオプションのMapを取得する。- Specified by:
getParamMapin interfaceRequest<String>- Returns:
- リクエストパラメータのMap
-
setParamMap
コマンドラインオプションのMapを設定する。- Parameters:
opts- 名前付きコマンドライン引数のMap- Returns:
- このオブジェクト自体
-
getArgs
コマンドライン引数のリストを返す。- Returns:
- 引数リスト
-