クラス AbstractComponent<T extends ComponentContext<T>>

java.lang.ObjectSE
org.springframework.shell.component.support.AbstractComponent<T>
実装されているすべてのインターフェース:
org.springframework.beans.factory.Awareorg.springframework.context.ResourceLoaderAware
既知の直属サブクラス
AbstractSelectorComponentAbstractTextComponent

public abstract class AbstractComponent<T extends ComponentContext<T>> extends ObjectSE implements org.springframework.context.ResourceLoaderAware
コンポーネントの基本クラス。
  • フィールドの詳細

  • コンストラクターの詳細

    • AbstractComponent

      public AbstractComponent(org.jline.terminal.Terminal terminal)
  • メソッドの詳細

    • setResourceLoader

      public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
      次で指定:
      インターフェース org.springframework.context.ResourceLoaderAwaresetResourceLoader 
    • getTerminal

      public org.jline.terminal.Terminal getTerminal()
      Terminal を取得します。
      戻り値:
      ターミナル
    • setRenderer

      public void setRenderer(FunctionSE<T,ListSE<org.jline.utils.AttributedString>> renderer)
      表示レンダラーを設定します。
      パラメーター:
      renderer - 表示レンダラー関数
    • render

      public ListSE<org.jline.utils.AttributedString> render(T context)
      指定されたコンテキストを使用して、設定されたディスプレイレンダラーでディスプレイのコンテンツを表示するようにレンダリングします。
      パラメーター:
      context - コンテキスト
      戻り値:
      属性付き文字列のリスト
    • addPreRunHandler

      public void addPreRunHandler(ConsumerSE<T> handler)
      実行前ハンドラーを追加します。
      パラメーター:
      handler - ハンドラー
    • addPostRunHandler

      public void addPostRunHandler(ConsumerSE<T> handler)
      実行後のハンドラーを追加します。
      パラメーター:
      handler - ハンドラー
    • setPrintResults

      public void setPrintResults(boolean printResults)
      結果をコンソールに出力するかどうかを設定します。デフォルトは true です。
      パラメーター:
      printResults - 結果を出力する場合のフラグ設定
    • run

      public final T run(ComponentContext<?> context)
      指定されたコンテキストでコンポーネントロジックを実行し、更新されたコンテキストを返します。
      パラメーター:
      context - コンテキスト
      戻り値:
      コンテキスト
    • getTemplateExecutor

      public TemplateExecutor getTemplateExecutor()
      テンプレートエグゼキュータを取得します。
      戻り値:
      テンプレートエグゼキュータ
    • setTemplateExecutor

      public void setTemplateExecutor(TemplateExecutor templateExecutor)
      テンプレート実行者を設定します。
      パラメーター:
      templateExecutor - テンプレート実行者
    • setTemplateLocation

      public void setTemplateLocation(StringSE templateLocation)
      テンプレートの場所を設定します。
      パラメーター:
      templateLocation - テンプレートの場所
    • hasTty

      protected boolean hasTty()
      このコンポーネントに既存の tty があるかどうかを確認します。
      戻り値:
      コンポーネントに tty がある場合は true
    • renderTemplateResource

      protected ListSE<org.jline.utils.AttributedString> renderTemplateResource(MapSE<StringSE,ObjectSE> attributes)
      特定のテンプレートを属性付きでレンダリングします。
      パラメーター:
      attributes - 属性
      戻り値:
      コンテンツを属性付き文字列としてレンダリング
    • getThisContext

      public abstract T getThisContext(ComponentContext<?> context)
      共通のこのトリックを使用して、実際のコンポーネントコンテキストを取得します。
      パラメーター:
      context - コンテキスト
      戻り値:
      コンポーネントコンテキスト
    • read

      protected abstract boolean read(org.jline.keymap.BindingReader bindingReader, org.jline.keymap.KeyMap<StringSE> keyMap, T context)
      入力を読み取ります。
      パラメーター:
      bindingReader - バインディングリーダー
      keyMap - キーマップ
      context - コンテキスト
      戻り値:
      読み取りが完了した場合は true、停止する場合は false
    • runInternal

      protected abstract T runInternal(T context)
      public run メソッドから呼び出される内部ロジックを実行します。
      パラメーター:
      context - コンテキスト
      戻り値:
      コンテキスト
    • bindKeyMap

      protected abstract void bindKeyMap(org.jline.keymap.KeyMap<StringSE> keyMap)
      キーマップをバインドします。
      パラメーター:
      keyMap -
    • loop

      protected void loop(ComponentContext<?> context)
      読み取りループに入ります。これは、コンポーネントから呼び出す必要があります。
      パラメーター:
      context - コンテキスト
    • runPreRunHandlers

      protected T runPreRunHandlers(T context)
      実行前ハンドラーを実行する
      パラメーター:
      context - コンテキスト
      戻り値:
      コンテキスト
    • runPostRunHandlers

      protected T runPostRunHandlers(T context)
      実行後のハンドラーを実行する
      パラメーター:
      context - コンテキスト
      戻り値:
      コンテキスト