title: How to parse a JSON object into a custom object using Gson?
body: <p>I have the following JSON object as a String:</p>
  
  <pre><code>[{"Add1":"101","Description":null,"ID":1,"Name":"Bundesverfassung","Short":"BV"},{"Add1":"220","Description":null,"ID":2,"Name":"Obligationenrecht","Short":"OR"},{"Add1":"210","Description":null,"ID":3,"Name":"Schweizerisches Zivilgesetzbuch","Short":"ZGB"},{"Add1":"311_0","Description":null,"ID":4,"Name":"Schweizerisches Strafgesetzbuch","Short":null}]
  </code></pre>
  
  <p>Now i created a class that represents one of the results:</p>
  
  <pre><code>public class Book {
  
      private int number;
      private String description;
      private int id;
      private String name;
      private String abbrevation;
  
      public Book(int number, String description, int id, String name, String abbrevation) {
          this.number = number;
          this.description = description;
          this.id = id;
          this.name = name;
          this.abbrevation = abbrevation;
      }
  
  }
  </code></pre>
  
  <p>Now I want to use <a href="http://sites.google.com/site/gson/" rel="nofollow">Gson</a> to parse the JSON object into a list of Book objects. I tried it this way, but obviously it doesn't work. How can I fix that?</p>
  
  <pre><code>public static Book[] fromJSONtoBook(String response) {
          Gson gson = new Gson();
          return gson.fromJson(response, Book[].class);
      }
  </code></pre>