インターフェース CommandContext

すべての既知の実装クラス:
CommandContext.DefaultCommandContext

public interface CommandContext
現在のコマンド実行に関する情報を含むインターフェース。
  • メソッドの詳細

    • getRawArgs

      StringSE[] getRawArgs()
      現在実行中のコマンドに渡された生の引数を取得します。
      戻り値:
      生のコマンド引数
    • hasMappedOption

      boolean hasMappedOption(StringSE name)
      オプションがマップされているかどうかを取得します。
      パラメーター:
      name - オプション名
      戻り値:
      オプションがマップされている場合は true、そうでない場合は false
    • getParserResults

      コマンドオプションパーサーの結果を取得します。
      戻り値:
      コマンドオプションパーサーの結果
    • getCommandRegistration

      CommandRegistration getCommandRegistration()
      コマンド登録を取得します。
      戻り値:
      コマンド登録
    • getOptionValue

      <T> T getOptionValue(StringSE name)
      マップされたオプション値を取得します。
      型パラメーター:
      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 - コマンド登録
      戻り値:
      コマンドコンテキスト