インターフェース CommandContext
- すべての既知の実装クラス:
CommandContext.DefaultCommandContext
public interface CommandContext
現在のコマンド実行に関する情報を含むインターフェース。
ネストされたクラスの要約
ネストされたクラス方法の概要
修飾子と型メソッド説明コマンド登録を取得します。<T> TgetOptionValue(StringSE name) マップされたオプション値を取得します。コマンドオプションパーサーの結果を取得します。StringSE[]現在実行中のコマンドに渡された生の引数を取得します。CommandContextに関連付けられたShellContextを取得します。org.jline.terminal.Terminalターミナルを取得します。booleanhasMappedOption(StringSE name) オプションがマップされているかどうかを取得します。static CommandContextof(StringSE[] args, CommandParser.CommandParserResults results, org.jline.terminal.Terminal terminal, CommandRegistration commandRegistration, ShellContext shellContext) デフォルトのCommandContextのインスタンスを取得します。
メソッドの詳細
getRawArgs
StringSE[] getRawArgs()現在実行中のコマンドに渡された生の引数を取得します。- 戻り値:
- 生のコマンド引数
hasMappedOption
オプションがマップされているかどうかを取得します。- パラメーター:
name- オプション名- 戻り値:
- オプションがマップされている場合は true、そうでない場合は false
getParserResults
CommandParser.CommandParserResults getParserResults()コマンドオプションパーサーの結果を取得します。- 戻り値:
- コマンドオプションパーサーの結果
getCommandRegistration
CommandRegistration getCommandRegistration()コマンド登録を取得します。- 戻り値:
- コマンド登録
getOptionValue
マップされたオプション値を取得します。- 型パラメーター:
T- マップする型- パラメーター:
name- オプション名- 戻り値:
- マップされた値
getTerminal
org.jline.terminal.Terminal getTerminal()ターミナルを取得します。- 戻り値:
- ターミナル
getShellContext
ShellContext getShellContext()CommandContextに関連付けられたShellContextを取得します。- 戻り値:
- シェルコンテキスト
of
static CommandContext of(StringSE[] args, CommandParser.CommandParserResults results, org.jline.terminal.Terminal terminal, CommandRegistration commandRegistration, ShellContext shellContext) デフォルトのCommandContextのインスタンスを取得します。- パラメーター:
args- 引数results- 結果terminal- ターミナルcommandRegistration- コマンド登録- 戻り値:
- コマンドコンテキスト