Improve ConfigBeanFactory docs in README

This commit is contained in:
Havoc Pennington 2015-03-02 11:03:38 -05:00
parent c1a7ce0333
commit 55bd472c24

View File

@ -437,12 +437,13 @@ and
### ConfigBeanFactory
If you have a Java object that follows JavaBean conventions
(zero-args constructor, getters and setters), you can
automatically initialize it from a `Config`.
As of version 1.3.0, if you have a Java object that follows
JavaBean conventions (zero-args constructor, getters and setters),
you can automatically initialize it from a `Config`.
Use `ConfigBeanFactory.create(MyBean.class,
config.getConfig("subtree-that-matches-bean"))` to do this.
Use
`ConfigBeanFactory.create(config.getConfig("subtree-that-matches-bean"),
MyBean.class)` to do this.
Creating a bean from a `Config` automatically validates that the
config matches the bean's implied schema. Bean fields can be