title: Simple java library to deserialise json to a java object using getters/setter and not properties(GSON)
body: <p>I am currently working on a REST based application and need to convert a json object to a class. The problem is that class is from a third party library and I do not have access to the source file. 
  Further the properties in the java object does not match to the getter/setters in the class(does not follow the java bean convention). For example if I try to deserialize the following json to a SimpleObject I get nulls instead of the actual data.</p>
  
  <p><strong>JSON input:</strong></p>
  
  <pre><code>{
     name: 'Test',
     id: '1'
  }
  </code></pre>
  
  <p><strong>Java class to deserialize to</strong></p>
  
  <pre><code>public class SampleObject {
      private String myName;
      private Long myId;
  
      public Long getId() {
          return this.myId;
      }
  
      public String getName() {
          return this.myName;
      }
      .. // setters
  }
  </code></pre>
  
  <p><strong>Test class</strong></p>
  
  <pre><code>public class TestGson {
  
    public static void main(final String[] args) {
      final Gson gson = new Gson();
      final SampleObject smapleObject = gson.fromJson("{"
              + "name:'Test',"
              + "id: 1"
              + "}", SampleObject.class);
      System.out.println(smapleObject.getName());
      System.out.println(smapleObject.getId());
    }
  }
  </code></pre>
  
  <p><strong>Result:</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>null
  null
  </code></pre>
  
  <p><strong>Expected:</strong></p>
  
  <pre class="lang-none prettyprint-override"><code>Test
  1
  </code></pre>
  
  <p>The problem is that gson uses the properties to deserialize the json whereas my requirement is to use the getter and setters.The class has getter and setters for all the properties and should not have any properties that does not have one.</p>
  
  <p>Is there any other simple json library that I can use to achieve this without modifying the existing class(Cannot add annotations as the source is not available). I had a look at Jackson but it seems to add a bit complexity to do such a simple task and my team mates are not happy with it.</p>