Annotation Type ConfigurationProperties
Binds a group of configuration keys to the setters of a bean.
@Component
@ConfigurationProperties("mail")
public class MailSettings {
private String host = "localhost";
private int port = 25;
public void setHost(String host) { this.host = host; }
public void setPort(int port) { this.port = port; }
}
Reads mail.host and mail.port, and calls a setter only when its key is
set, so a field initializer is the default. The build lists the setters and
writes one typed read per setter into the entry point; nothing is discovered
at run time. Spring's relaxed binding applies to the setter name: setMaxSize
reads mail.max-size when mail.maxSize is not set.
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
-
prefix
-