org.springframework.boot.context.properties
Annotation Type ConfigurationProperties


@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface ConfigurationProperties

Annotation for externalized configuration. Add this to a class definition if you want to bind and validate some external Properties (e.g. from a .properties file).

Author:
Dave Syer
See Also:
ConfigurationPropertiesBindingPostProcessor

Optional Element Summary
 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 name
          The (optional) name of the object to be bound.
 String[] path
          Optionally provide an explicit resource path to bind to instead of using the default environment.
 String value
          The (optional) name of the object to be bound.
 

value

public abstract String value
The (optional) name of the object to be bound. Properties to bind can have a name prefix to select the properties that are valid to this object. Synonym for name().

Returns:
the name prefix of the properties to bind
Default:
""

name

public abstract String name
The (optional) name of the object to be bound. Properties to bind can have a name prefix to select the properties that are valid to this object. Synonym for value().

Returns:
the name prefix of the properties to bind
Default:
""

ignoreInvalidFields

public abstract 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).

Returns:
the flag value (default false)
Default:
false

ignoreUnknownFields

public abstract 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.

Returns:
the flag value (default true)
Default:
true

path

public abstract String[] path
Optionally provide an explicit resource path to bind to instead of using the default environment.

Returns:
the path (or paths) of resources to bind to
Default:
{}


Copyright © 2013. All Rights Reserved.