JSONObject as class attribute storage/retrieval
<p>In android, I'm using model classes with methods to handle the data manipulation. My data is brought in from webservices as json. I'm contemplating the possibility of using JSONObjects to store the values of class level attributes. But, I don't know of a way to use the JSONObj as the "holder" variable and create access methods. I don't want to predetermine these methods, as jsonRepository should hold the values, not always known at design time</p>

<p>For example, I'd like to have:
    public class User {
    private JSONObject jsonAttributes;</p>

<pre><code>public User(String json) { 
    this.jsonAttributes= new JSONObject(json);
}

[IMPLICIT attribute access methods]

public string Prop1() returns jsonAttributes.getString("prop1");
public string Prop1(String newProp1) returns jsonAttributes.putString("prop1",newProp1);

public string Prop2() returns jsonRepository.getString("id");
public string Prop2(String newProp2) returns jsonAttributes.putString("prop2",newProp2);
....
</code></pre>

<p>from outside this class then, I would access the attributes simply...</p>

<pre><code>User myUser = new User(someValidJson);
String myString = myUser.Prop1
</code></pre>

<p><strong>Misguided? If not, how does one manage implicit property setting/getting?</strong></p>
