インターフェース ComponentContext<C extends ComponentContext<C>>

既知のすべてのサブインターフェース:
AbstractSelectorComponent.SelectorComponentContext<T,I,C>AbstractTextComponent.TextComponentContext<T,C>ConfirmationInput.ConfirmationInputContextMultiItemSelector.MultiItemSelectorContext<T,I>PathInput.PathInputContextPathSearch.PathSearchContextSingleItemSelector.SingleItemSelectorContext<T,I>StringInput.StringInputContext
すべての既知の実装クラス:
AbstractSelectorComponent.BaseSelectorComponentContextAbstractTextComponent.BaseTextComponentContextBaseComponentContext

public interface ComponentContext<C extends ComponentContext<C>>
基本的なキーと値のペアにアクセスできる基本コンポーネントコンテキストの契約。これは、コンポーネントが独自のコンポーネント固有のコンテキストを提供するために拡張できる基本コンテキストです。
  • メソッドの詳細

    • empty

      static <C extends ComponentContext<C>> ComponentContext<C> empty()
      空のコンテキストを取得します。
      型パラメーター:
      C - コンテキストの型
      戻り値:
      空のコンテキスト
    • get

      <T> T get(ObjectSE key)
      コンテキストから値を取得します。
      型パラメーター:
      T - コンテキストの型
      パラメーター:
      key - キー
      戻り値:
      価値
    • get

      <T> T get(ObjectSE key, ClassSE<T> type)
      キャスト先の特定の型のコンテキストから値を取得します。
      型パラメーター:
      T - コンテキストの型
      パラメーター:
      key - キー
      type - クラスの種類
      戻り値:
      価値
    • containsKey

      boolean containsKey(ObjectSE key)
      コンテキストにキーが含まれているかどうかを確認します。
      パラメーター:
      key - キー
      戻り値:
      コンテキストにキーが含まれる場合は true
    • put

      ComponentContext<C> put(ObjectSE key, ObjectSE value)
      エントリをコンテキストに入れます。
      パラメーター:
      key - エントリキー
      value - エントリ値
      戻り値:
      コンテキスト
    • stream

      この ComponentContext からキーと値のペアをストリーミングします
      戻り値:
      このコンテキストが保持するキーと値のペアの StreamSE
    • getTerminalWidth

      IntegerSE getTerminalWidth()
      ターミナルの幅を取得します。
      戻り値:
      端子幅
    • setTerminalWidth

      void setTerminalWidth(IntegerSE terminalWidth)
      端子幅を設定します。
      パラメーター:
      terminalWidth - 幅
    • toTemplateModel

      MapSE<StringSE,ObjectSE> toTemplateModel()
      コンテキスト値をマップとして取得します。すべてのコンテキスト実装は、テンプレートエンジンにフィードされる可能性が最も高い最後の子から出てくるものであるため、本質的に独自のモデルを実行できます。
      戻り値:
      コンテキスト値のマップ