クラス CompositePropertySource


public class CompositePropertySource extends EnumerablePropertySource<ObjectSE>
一連の PropertySource インスタンスを反復処理する複合 PropertySource 実装。複数のプロパティソースが同じ名前を共有する場合に必要です。@PropertySource に複数の値が提供されている場合。

Spring 4.1.2 の時点で、このクラスはプレーン PropertySource の代わりに EnumerablePropertySource を継承し、含まれているすべてのソースからの累積プロパティ名に基づいて getPropertyNames() を公開します(可能な限り)。

導入:
3.1.1
作成者:
Chris Beams, Juergen Hoeller, Phillip Webb
  • コンストラクターの詳細

    • CompositePropertySource

      public CompositePropertySource(StringSE name)
      新しい CompositePropertySource を作成します。
      パラメーター:
      name - プロパティソースの名前
  • メソッドの詳細

    • getProperty

      @Nullable public ObjectSE getProperty(StringSE name)
      クラスからコピーされた説明: PropertySource
      指定された名前に関連付けられた値を返します。見つからない場合は null を返します。
      次で指定:
      クラス PropertySource<ObjectSE>getProperty 
      パラメーター:
      name - 検索するプロパティ
      関連事項:
    • containsProperty

      public boolean containsProperty(StringSE name)
      クラスからコピーされた説明: EnumerablePropertySource
      この PropertySource に、指定された名前のプロパティが含まれているかどうかを返します。

      この実装は、EnumerablePropertySource.getPropertyNames() 配列内の指定された名前の存在を確認します。

      オーバーライド:
      クラス EnumerablePropertySource<ObjectSE>containsProperty 
      パラメーター:
      name - 検索するプロパティの名前
    • getPropertyNames

      public StringSE[] getPropertyNames()
      クラスからコピーされた説明: EnumerablePropertySource
      ソースオブジェクトに含まれるすべてのプロパティの名前を返します(null は決してしないでください)。
      次で指定:
      クラス EnumerablePropertySource<ObjectSE>getPropertyNames 
    • addPropertySource

      public void addPropertySource(PropertySource<?> propertySource)
      指定された PropertySource をチェーンの末尾に追加します。
      パラメーター:
      propertySource - 追加する PropertySource
    • addFirstPropertySource

      public void addFirstPropertySource(PropertySource<?> propertySource)
      指定された PropertySource をチェーンの先頭に追加します。
      パラメーター:
      propertySource - 追加する PropertySource
      導入:
      4.1
    • getPropertySources

      public CollectionSE<PropertySource<?>> getPropertySources()
      この複合ソースが保持するすべてのプロパティソースを返します。
      導入:
      4.1.1
    • toString

      public StringSE toString()
      クラスからコピーされた説明: PropertySource
      現在のログレベルにデバッグが含まれていない場合は、簡潔な出力(型と名前)を生成します。デバッグが有効になっている場合は、PropertySource インスタンスのハッシュコードとすべての名前 / 値プロパティのペアを含む詳細な出力を生成します。

      この変数の冗長性は、システムプロパティや環境変数などのプロパティソースに任意の数のプロパティペアが含まれている可能性があり、例外やログメッセージの読み取りが困難になる可能性があるため便利です。

      オーバーライド:
      クラス PropertySource<ObjectSE>toString 
      関連事項: