@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Documented public @interface ConfigurationProperties
@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.
ConfigurationPropertiesBindingPostProcessor
,
EnableConfigurationProperties
Modifier and Type | Optional Element and Description |
---|---|
boolean |
exceptionIfInvalid
Flag to indicate that an exception should be raised if a Validator is available and
validation fails.
|
boolean |
ignoreInvalidFields
Flag to indicate that when binding to this object invalid fields should be ignored.
|
boolean |
ignoreNestedProperties
Flag to indicate that when binding to this object fields with periods in their
names should be ignored.
|
boolean |
ignoreUnknownFields
Flag to indicate that when binding to this object unknown fields should be ignored.
|
String[] |
locations
Deprecated.
as of 1.4 in favor of configuring the environment directly with
additional locations
|
boolean |
merge
Deprecated.
as of 1.4 along with
locations() in favor of configuring the
environment directly with additional locations |
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.
|
public abstract boolean ignoreInvalidFields
public abstract boolean ignoreNestedProperties
public abstract boolean ignoreUnknownFields
public abstract boolean exceptionIfInvalid
@Deprecated public abstract String[] locations
merge()
@Deprecated public abstract boolean merge
locations()
in favor of configuring the
environment directly with additional locationslocations()
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.