Which Java library lets me initialize an object's properties from a properties file?
<p>Is there a Java library that lets you "deserialize" a properties file directly into an object instance?</p>

<p><strong>Example:</strong> say you have a file called init.properties:</p>

<pre><code>username=fisk
password=frosk
</code></pre>

<p>and a Java class with some properties:</p>

<pre><code>class Connection {

    private String username;
    private String password;

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
</code></pre>

<p>I want to do this:</p>

<pre><code>Connection c = MagicConfigurator.configure("init.properties", new Connection())
</code></pre>

<p>and have MagicConfigurator apply all the values from the properties file to the Connection instance.</p>

<p>Is there a library with a class like this?</p>
