クラス MutablePropertySources

java.lang.ObjectSE
org.springframework.core.env.MutablePropertySources
実装されたすべてのインターフェース:
IterableSE<PropertySource<?>>PropertySources

public class MutablePropertySources extends ObjectSE implements PropertySources
PropertySources インターフェースのデフォルト実装。含まれているプロパティソースの操作を許可し、既存の PropertySources インスタンスをコピーするためのコンストラクターを提供します。

addFirst(org.springframework.core.env.PropertySource<?>)addLast(org.springframework.core.env.PropertySource<?>) などのメソッドで優先順位がメンションされている場合、これは、PropertyResolver で特定のプロパティを解決するときにプロパティソースが検索される順序に関するものです。

導入:
3.1
作成者:
Chris Beams, Juergen Hoeller
関連事項:
  • コンストラクターの詳細

    • MutablePropertySources

      public MutablePropertySources()
      新しい MutablePropertySources オブジェクトを作成します。
    • MutablePropertySources

      public MutablePropertySources(PropertySources propertySources)
      指定された propertySources オブジェクトから新しい MutablePropertySources を作成し、含まれている PropertySource オブジェクトの元の順序を維持します。
  • メソッドの詳細

    • iterator

      public IteratorSE<PropertySource<?>> iterator()
      次で指定:
      インターフェース IterableSE<PropertySource<?>>iterator 
    • spliterator

      public SpliteratorSE<PropertySource<?>> spliterator()
      次で指定:
      インターフェース IterableSE<PropertySource<?>>spliterator 
    • stream

      public StreamSE<PropertySource<?>> stream()
      インターフェースからコピーされた説明: PropertySources
      プロパティソースを含むシーケンシャル StreamSE を返します。
      次で指定:
      インターフェース PropertySourcesstream 
    • contains

      public boolean contains(StringSE name)
      インターフェースからコピーされた説明: PropertySources
      指定された名前のプロパティソースが含まれているかどうかを返します。
      次で指定:
      インターフェース PropertySourcescontains 
      パラメーター:
      name - 検索するプロパティソースの名前
    • get

      @Nullable public PropertySource<?> get(StringSE name)
      インターフェースからコピーされた説明: PropertySources
      指定された名前、null が見つからない場合、プロパティソースを返します。
      次で指定:
      インターフェース PropertySourcesget 
      パラメーター:
      name - 検索するプロパティソースの名前
    • addFirst

      public void addFirst(PropertySource<?> propertySource)
      指定されたプロパティソースオブジェクトを最高の優先順位で追加します。
    • addLast

      public void addLast(PropertySource<?> propertySource)
      優先順位が最も低い特定のプロパティソースオブジェクトを追加します。
    • addBefore

      public void addBefore(StringSE relativePropertySourceName, PropertySource<?> propertySource)
      指定されたプロパティソースオブジェクトを、指定された相対プロパティソースのすぐ上の優先順位で追加します。
    • addAfter

      public void addAfter(StringSE relativePropertySourceName, PropertySource<?> propertySource)
      指定されたプロパティソースオブジェクトを、名前付きの相対プロパティソースのすぐ下の優先順位で追加します。
    • precedenceOf

      public int precedenceOf(PropertySource<?> propertySource)
      指定されたプロパティソースの優先順位を返します。見つからない場合は -1 を返します。
    • remove

      @Nullable public PropertySource<?> remove(StringSE name)
      指定された名前のプロパティソースを削除して返します。見つからない場合は null を返します。
      パラメーター:
      name - 検索して削除するプロパティソースの名前
    • replace

      public void replace(StringSE name, PropertySource<?> propertySource)
      指定された名前のプロパティソースを指定されたプロパティソースオブジェクトに置き換えます。
      パラメーター:
      name - 検索および置換するプロパティソースの名前
      propertySource - 置換プロパティソース
      例外:
      IllegalArgumentExceptionSE - 指定された名前のプロパティソースが存在しない場合
      関連事項:
    • size

      public int size()
      含まれる PropertySource オブジェクトの数を返します。
    • toString

      public StringSE toString()
      オーバーライド:
      クラス ObjectSEtoString 
    • assertLegalRelativeAddition

      protected void assertLegalRelativeAddition(StringSE relativePropertySourceName, PropertySource<?> propertySource)
      指定されたプロパティソースがそれ自体に対して追加されていないことを確認してください。
    • removeIfPresent

      protected void removeIfPresent(PropertySource<?> propertySource)
      指定されたプロパティソースが存在する場合は削除します。