Binder

open class Binder

A container object which Binds objects from one or more ConfigurationPropertySources.

Author

Phillip Webb

Madhura Bhave

Since

2.0.0

Constructors

Link copied to clipboard
constructor(sources: Array<ConfigurationPropertySource>)
Create a new Binder instance for the specified sources.
constructor(sources: Iterable<ConfigurationPropertySource>)
Create a new Binder instance for the specified sources.
constructor(sources: Iterable<ConfigurationPropertySource>, placeholdersResolver: PlaceholdersResolver)
Create a new Binder instance for the specified sources.
constructor(sources: Iterable<ConfigurationPropertySource>, placeholdersResolver: PlaceholdersResolver, conversionService: ConversionService)
Create a new Binder instance for the specified sources.
constructor(sources: Iterable<ConfigurationPropertySource>, placeholdersResolver: PlaceholdersResolver, conversionService: ConversionService, propertyEditorInitializer: Consumer<PropertyEditorRegistry>)
Create a new Binder instance for the specified sources.
constructor(sources: Iterable<ConfigurationPropertySource>, placeholdersResolver: PlaceholdersResolver, conversionService: ConversionService, propertyEditorInitializer: Consumer<PropertyEditorRegistry>, defaultBindHandler: BindHandler)
Create a new Binder instance for the specified sources.
constructor(sources: Iterable<ConfigurationPropertySource>, placeholdersResolver: PlaceholdersResolver, conversionService: ConversionService, propertyEditorInitializer: Consumer<PropertyEditorRegistry>, defaultBindHandler: BindHandler, constructorProvider: BindConstructorProvider)
Create a new Binder instance for the specified sources.
constructor(sources: Iterable<ConfigurationPropertySource>, placeholdersResolver: PlaceholdersResolver, conversionServices: List<ConversionService>, propertyEditorInitializer: Consumer<PropertyEditorRegistry>, defaultBindHandler: BindHandler, constructorProvider: BindConstructorProvider)
Create a new Binder instance for the specified sources.

Functions

Link copied to clipboard
open fun <T> bind(name: String, target: Class<T>): BindResult<T>
Bind the specified target Class using this binder's property sources.
open fun <T> bind(name: String, target: Bindable<T>): BindResult<T>
open fun <T> bind(name: ConfigurationPropertyName, target: Bindable<T>): BindResult<T>
open fun <T> bind(name: String, target: Bindable<T>, handler: BindHandler): BindResult<T>
open fun <T> bind(name: ConfigurationPropertyName, target: Bindable<T>, handler: BindHandler): BindResult<T>
Bind the specified target Bindable using this binder's property sources.
Link copied to clipboard
open fun <T> bindOrCreate(name: String, target: Class<T>): T
Bind the specified target Class using this binder's property sources or create a new instance of the specified target Class if the result of the binding is null.
open fun <T> bindOrCreate(name: String, target: Bindable<T>): T
open fun <T> bindOrCreate(name: String, target: Bindable<T>, handler: BindHandler): T
open fun <T> bindOrCreate(name: ConfigurationPropertyName, target: Bindable<T>, handler: BindHandler): T
Bind the specified target Bindable using this binder's property sources or create a new instance using the type of the Bindable if the result of the binding is null.
Link copied to clipboard
open fun get(environment: Environment): Binder
open fun get(environment: Environment, defaultBindHandler: BindHandler): Binder
Create a new Binder instance from the specified environment.