title: Using GSON with object to print JSON object
body: <p>Quick questions about GSON, after reading the documentation. This is what I have with JSON:</p>
  
  <pre><code>var json = { 
       id: "person1", 
       name: "person 1", 
       data: {"email": "1@test.com"},
       children: [{
                      id: "person2",
                      name: "person 2",
                      data: {"email": "2@test.com"},
                      children: []
                  },{
                      id: "person3",
                      name: "person 3",
                      data: {"email": "3@test.com"},
                      children: []
                  }
                  ] 
  } 
  </code></pre>
  
  <p>1) Can I use GSON without using Class objects in Java? Can this be done easily using GSON and Java. Meaning I can do something like</p>
  
  <pre><code>GSON gson = new GSON();
  gson.toJson("name", "person 1");
  </code></pre>
  
  <p>2) When I use this example:</p>
  
  <pre><code>            Gson gson = new Gson();
              Person p = new Contact(rs.getString("name"));
              gson.toJson(p);
              String json = gson.toString();
              System.out.println(json);
  </code></pre>
  
  <p>My Json output is not what I expected. That Person instance is a public class instance with just one property - name (for testing purposes). Why would I see essentially Factory, serializeNulls, etc in the output?</p>
  
  <p>Thanks</p>