类的使用
org.springframework.boot.context.properties.bind.Bindable
使用Bindable的程序包
程序包
说明
Support for external configuration properties.
Support for
@ConfigurationProperties
binding.General
BindHandler
implementations.Binding validation support.
-
org.springframework.boot.context.properties中Bindable的使用
-
org.springframework.boot.context.properties.bind中Bindable的使用
修饰符和类型方法说明Bindable
<?> BindException.getTarget()
Return the target being bound.static <T> Bindable
<T> Create a newBindable
of the specified type.static <T> Bindable
<T> Bindable.of
(ResolvableType type) Create a newBindable
of the specified type.static <T> Bindable
<T> Bindable.ofInstance
(T instance) Create a newBindable
of the type of the specified instance with an existing value equal to the instance.<T> Bindable
<T> AbstractBindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) default <T> Bindable
<T> BindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) Called when binding of an element starts but before any result has been determined.Bindable.withAnnotations
(Annotation... annotations) Create an updatedBindable
instance with the specified annotations.Bindable.withBindMethod
(BindMethod bindMethod) Create an updatedBindable
instance with a specific bind method.Bindable.withBindRestrictions
(Bindable.BindRestriction... additionalRestrictions) Create an updatedBindable
instance with additional bind restrictions.Bindable.withExistingValue
(T existingValue) Create an updatedBindable
instance with an existing value.Bindable.withSuppliedValue
(Supplier<T> suppliedValue) Create an updatedBindable
instance with a value supplier.修饰符和类型方法说明<T> BindResult
<T> Bind the specified targetBindable
using this binder'sproperty sources
.<T> BindResult
<T> Binder.bind
(String name, Bindable<T> target, BindHandler handler) Bind the specified targetBindable
using this binder'sproperty sources
.<T> BindResult
<T> Binder.bind
(ConfigurationPropertyName name, Bindable<T> target) Bind the specified targetBindable
using this binder'sproperty sources
.<T> BindResult
<T> Binder.bind
(ConfigurationPropertyName name, Bindable<T> target, BindHandler handler) Bind the specified targetBindable
using this binder'sproperty sources
.<T> T
Binder.bindOrCreate
(String name, Bindable<T> target) Bind the specified targetBindable
using this binder'sproperty sources
or create a new instance using the type of theBindable
if the result of the binding isnull
.<T> T
Binder.bindOrCreate
(String name, Bindable<T> target, BindHandler handler) Bind the specified targetBindable
using this binder'sproperty sources
or create a new instance using the type of theBindable
if the result of the binding isnull
.<T> T
Binder.bindOrCreate
(ConfigurationPropertyName name, Bindable<T> target, BindHandler handler) Bind the specified targetBindable
using this binder'sproperty sources
or create a new instance using the type of theBindable
if the result of the binding isnull
.BindableRuntimeHintsRegistrar.forBindables
(Bindable<?>... bindables) Create a newBindableRuntimeHintsRegistrar
for the specified bindables.Constructor
<?> BindConstructorProvider.getBindConstructor
(Bindable<?> bindable, boolean isNestedConstructorBinding) Return the bind constructor to use for the given bindable, ornull
if constructor binding is not supported.default Object
BindHandler.onCreate
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) Called when binding of an element ends with an unbound result and a newly created instance is about to be returned.AbstractBindHandler.onFailure
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) default Object
BindHandler.onFailure
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) Called when binding fails for any reason (including failures fromBindHandler.onSuccess(org.springframework.boot.context.properties.source.ConfigurationPropertyName, org.springframework.boot.context.properties.bind.Bindable<?>, org.springframework.boot.context.properties.bind.BindContext, java.lang.Object)
orBindHandler.onCreate(org.springframework.boot.context.properties.source.ConfigurationPropertyName, org.springframework.boot.context.properties.bind.Bindable<?>, org.springframework.boot.context.properties.bind.BindContext, java.lang.Object)
calls).void
AbstractBindHandler.onFinish
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) default void
BindHandler.onFinish
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) Called when binding finishes with either bound or unbound result.<T> Bindable
<T> AbstractBindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) default <T> Bindable
<T> BindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) Called when binding of an element starts but before any result has been determined.AbstractBindHandler.onSuccess
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) default Object
BindHandler.onSuccess
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) Called when binding of an element ends with a successful result.BoundPropertiesTrackingBindHandler.onSuccess
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) 类型变量类型为Bindable的org.springframework.boot.context.properties.bind中的方法参数修饰符和类型方法说明BindableRuntimeHintsRegistrar.forBindables
(Iterable<Bindable<?>> bindables) Create a newBindableRuntimeHintsRegistrar
for the specified bindables.限定符构造器说明protected
BindableRuntimeHintsRegistrar
(Bindable<?>... bindables) Create a newBindableRuntimeHintsRegistrar
for the specified bindables. -
org.springframework.boot.context.properties.bind.handler中Bindable的使用
修饰符和类型方法说明<T> Bindable
<T> NoUnboundElementsBindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) 修饰符和类型方法说明IgnoreErrorsBindHandler.onFailure
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) IgnoreTopLevelConverterNotFoundBindHandler.onFailure
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) NoUnboundElementsBindHandler.onFailure
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) void
NoUnboundElementsBindHandler.onFinish
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) <T> Bindable
<T> NoUnboundElementsBindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) NoUnboundElementsBindHandler.onSuccess
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) -
org.springframework.boot.context.properties.bind.validation中Bindable的使用
修饰符和类型方法说明<T> Bindable
<T> ValidationBindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) 修饰符和类型方法说明ValidationBindHandler.onFailure
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Exception error) void
ValidationBindHandler.onFinish
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result) <T> Bindable
<T> ValidationBindHandler.onStart
(ConfigurationPropertyName name, Bindable<T> target, BindContext context) ValidationBindHandler.onSuccess
(ConfigurationPropertyName name, Bindable<?> target, BindContext context, Object result)