クラス Binder

java.lang.ObjectSE
org.springframework.boot.context.properties.bind.Binder

public class Binder extends ObjectSE
1 つ以上の ConfigurationPropertySources からのオブジェクトをバインドするコンテナーオブジェクト。
導入:
2.0.0
作成者:
Phillip Webb, Madhura Bhave
  • コンストラクターの詳細

    • Binder

      public Binder(ConfigurationPropertySource... sources)
      指定されたソースの新しい Binder インスタンスを作成します。DefaultFormattingConversionService がすべての変換に使用されます。
      パラメーター:
      sources - バインディングに使用されるソース
    • Binder

      public Binder(IterableSE<ConfigurationPropertySource> sources)
      指定されたソースの新しい Binder インスタンスを作成します。DefaultFormattingConversionService がすべての変換に使用されます。
      パラメーター:
      sources - バインディングに使用されるソース
    • Binder

      public Binder(IterableSE<ConfigurationPropertySource> sources, @Nullable PlaceholdersResolver placeholdersResolver)
      指定されたソースの新しい Binder インスタンスを作成します。
      パラメーター:
      sources - バインディングに使用されるソース
      placeholdersResolver - プロパティのプレースホルダーを解決するための戦略
    • Binder

      public Binder(IterableSE<ConfigurationPropertySource> sources, @Nullable PlaceholdersResolver placeholdersResolver, @Nullable ConversionService conversionService)
      指定されたソースの新しい Binder インスタンスを作成します。
      パラメーター:
      sources - バインディングに使用されるソース
      placeholdersResolver - プロパティのプレースホルダーを解決するための戦略
      conversionService - 値を変換する変換サービス (または ApplicationConversionService を使用するには null )
    • Binder

      public Binder(IterableSE<ConfigurationPropertySource> sources, @Nullable PlaceholdersResolver placeholdersResolver, @Nullable ConversionService conversionService, @Nullable ConsumerSE<PropertyEditorRegistry> propertyEditorInitializer)
      指定されたソースの新しい Binder インスタンスを作成します。
      パラメーター:
      sources - バインディングに使用されるソース
      placeholdersResolver - プロパティのプレースホルダーを解決するための戦略
      conversionService - 値を変換する変換サービス (または ApplicationConversionService を使用するには null )
      propertyEditorInitializer - 値を変換できるプロパティエディター(または初期化が不要な場合は null)を構成するために使用される初期化子。多くの場合、ConfigurableBeanFactory.copyRegisteredEditorsTo(PropertyEditorRegistry) を呼び出すために使用されます。
    • Binder

      public Binder(IterableSE<ConfigurationPropertySource> sources, @Nullable PlaceholdersResolver placeholdersResolver, @Nullable ConversionService conversionService, @Nullable ConsumerSE<PropertyEditorRegistry> propertyEditorInitializer, @Nullable BindHandler defaultBindHandler)
      指定されたソースの新しい Binder インスタンスを作成します。
      パラメーター:
      sources - バインディングに使用されるソース
      placeholdersResolver - プロパティのプレースホルダーを解決するための戦略
      conversionService - 値を変換する変換サービス (または ApplicationConversionService を使用するには null )
      propertyEditorInitializer - 値を変換できるプロパティエディター(または初期化が不要な場合は null)を構成するために使用される初期化子。多くの場合、ConfigurableBeanFactory.copyRegisteredEditorsTo(PropertyEditorRegistry) を呼び出すために使用されます。
      defaultBindHandler - バインド時に何も指定されていない場合に使用するデフォルトのバインドハンドラー
      導入:
      2.2.0
    • Binder

      public Binder(IterableSE<ConfigurationPropertySource> sources, @Nullable PlaceholdersResolver placeholdersResolver, @Nullable ConversionService conversionService, @Nullable ConsumerSE<PropertyEditorRegistry> propertyEditorInitializer, @Nullable BindHandler defaultBindHandler, @Nullable BindConstructorProvider constructorProvider)
      指定されたソースの新しい Binder インスタンスを作成します。
      パラメーター:
      sources - バインディングに使用されるソース
      placeholdersResolver - プロパティのプレースホルダーを解決するための戦略
      conversionService - 値を変換する変換サービス (または ApplicationConversionService を使用するには null )
      propertyEditorInitializer - 値を変換できるプロパティエディター(または初期化が不要な場合は null)を構成するために使用される初期化子。多くの場合、ConfigurableBeanFactory.copyRegisteredEditorsTo(PropertyEditorRegistry) を呼び出すために使用されます。
      defaultBindHandler - バインド時に何も指定されていない場合に使用するデフォルトのバインドハンドラー
      constructorProvider - バインド時に使用するバインドコンストラクターを提供するコンストラクタープロバイダー
      導入:
      2.2.1
    • Binder

      public Binder(IterableSE<ConfigurationPropertySource> sources, @Nullable PlaceholdersResolver placeholdersResolver, @Nullable ListSE<ConversionService> conversionServices, @Nullable ConsumerSE<PropertyEditorRegistry> propertyEditorInitializer, @Nullable BindHandler defaultBindHandler, @Nullable BindConstructorProvider constructorProvider)
      指定されたソースの新しい Binder インスタンスを作成します。
      パラメーター:
      sources - バインディングに使用されるソース
      placeholdersResolver - プロパティのプレースホルダーを解決するための戦略
      conversionServices - 値を変換する変換サービス (または ApplicationConversionService を使用するには null )
      propertyEditorInitializer - 値を変換できるプロパティエディター(または初期化が不要な場合は null)を構成するために使用される初期化子。多くの場合、ConfigurableBeanFactory.copyRegisteredEditorsTo(PropertyEditorRegistry) を呼び出すために使用されます。
      defaultBindHandler - バインド時に何も指定されていない場合に使用するデフォルトのバインドハンドラー
      constructorProvider - バインド時に使用するバインドコンストラクターを提供するコンストラクタープロバイダー
      導入:
      2.5.0
  • メソッドの詳細

    • bind

      public <T> BindResult<T> bind(StringSE name, ClassSE<T> target)
      このバインダーの property sources を使用して、指定されたターゲット ClassSE をバインドします。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットクラス
      戻り値:
      バインディング結果 (非 null)
      関連事項:
    • bind

      public <T> BindResult<T> bind(StringSE name, Bindable<T> target)
      このバインダーの property sources を使用して、指定されたターゲット Bindable をバインドします。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットのバインド可能
      戻り値:
      バインディング結果 (非 null)
      関連事項:
    • bind

      public <T> BindResult<T> bind(ConfigurationPropertyName name, Bindable<T> target)
      このバインダーの property sources を使用して、指定されたターゲット Bindable をバインドします。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットのバインド可能
      戻り値:
      バインディング結果 (非 null)
      関連事項:
    • bind

      public <T> BindResult<T> bind(StringSE name, Bindable<T> target, @Nullable BindHandler handler)
      このバインダーの property sources を使用して、指定されたターゲット Bindable をバインドします。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットのバインド可能
      handler - バインドハンドラー (null の場合があります)
      戻り値:
      バインディング結果 (非 null)
    • bind

      public <T> BindResult<T> bind(ConfigurationPropertyName name, Bindable<T> target, @Nullable BindHandler handler)
      このバインダーの property sources を使用して、指定されたターゲット Bindable をバインドします。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットのバインド可能
      handler - バインドハンドラー (null の場合があります)
      戻り値:
      バインディング結果 (非 null)
    • bindOrCreate

      public <T> T bindOrCreate(StringSE name, ClassSE<T> target)
      このバインダーの property sources を使用して指定されたターゲット ClassSE をバインドするか、バインディングの結果が null の場合は、指定されたターゲット ClassSE の新しいインスタンスを作成します。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットクラス
      戻り値:
      バインドまたは作成されたオブジェクト
      導入:
      2.2.0
      関連事項:
    • bindOrCreate

      public <T> T bindOrCreate(StringSE name, Bindable<T> target)
      このバインダーの property sources を使用して指定されたターゲット Bindable をバインドするか、バインドの結果が null の場合、Bindable の型を使用して新しいインスタンスを作成します。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットのバインド可能
      戻り値:
      バインドまたは作成されたオブジェクト
      導入:
      2.2.0
      関連事項:
    • bindOrCreate

      public <T> T bindOrCreate(StringSE name, Bindable<T> target, BindHandler handler)
      このバインダーの property sources を使用して指定されたターゲット Bindable をバインドするか、バインドの結果が null の場合、Bindable の型を使用して新しいインスタンスを作成します。
      型パラメーター:
      T - バインドされた型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットのバインド可能
      handler - バインドハンドラー
      戻り値:
      バインドまたは作成されたオブジェクト
      導入:
      2.2.0
      関連事項:
    • bindOrCreate

      public <T> T bindOrCreate(ConfigurationPropertyName name, Bindable<T> target, @Nullable BindHandler handler)
      このバインダーの property sources を使用して指定されたターゲット Bindable をバインドするか、バインドの結果が null の場合、Bindable の型を使用して新しいインスタンスを作成します。
      型パラメーター:
      T - バインドまたは作成された型
      パラメーター:
      name - バインドする構成プロパティ名
      target - ターゲットのバインド可能
      handler - バインドハンドラー (null の場合があります)
      戻り値:
      バインドまたは作成されたオブジェクト
      導入:
      2.2.0
    • get

      public static Binder get(Environment environment)
      指定された環境から新しい Binder インスタンスを作成します。
      パラメーター:
      environment - 環境ソース (ConfigurationPropertySources がアタッチされている必要があります)
      戻り値:
      Binder インスタンス
    • get

      public static Binder get(Environment environment, @Nullable BindHandler defaultBindHandler)
      指定された環境から新しい Binder インスタンスを作成します。
      パラメーター:
      environment - 環境ソース (ConfigurationPropertySources がアタッチされている必要があります)
      defaultBindHandler - バインド時に何も指定されていない場合に使用するデフォルトのバインドハンドラー
      戻り値:
      Binder インスタンス
      導入:
      2.2.0