注释类型 ConfigurationProperties
@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented public @interface ConfigurationProperties
Annotation for externalized configuration. Add this to a class definition or a@Bean
method in a@Configuration
class if you want to bind and validate some external Properties (e.g. from a .properties file).Note that contrary to
@Value
, SpEL expressions are not evaluated since property values are externalized.
可选元素概要
可选元素 修饰符和类型 可选元素 说明 boolean
ignoreInvalidFields
Flag to indicate that when binding to this object invalid fields should be ignored.boolean
ignoreUnknownFields
Flag to indicate that when binding to this object unknown fields should be ignored.String
prefix
The name prefix of the properties that are valid to bind to this object.String
value
The name prefix of the properties that are valid to bind to this object.
ignoreInvalidFields
boolean ignoreInvalidFields
Flag to indicate that when binding to this object invalid fields should be ignored. Invalid means invalid according to the binder that is used, and usually this means fields of the wrong type (or that cannot be coerced into the correct type).- 返回:
- the flag value (default false)
- 默认值:
- false
ignoreUnknownFields
boolean ignoreUnknownFields
Flag to indicate that when binding to this object unknown fields should be ignored. An unknown field could be a sign of a mistake in the Properties.- 返回:
- the flag value (default true)
- 默认值:
- true