title: How does play.libs.Json.fromJson handled a List<T> in Java?
body: <p>I'd like to use the Json library that comes with the play 2.1 framework.
  But I'm stuck with deserializing a json object back into a java List.</p>
  
  <p>With gson, you can write s.th. like</p>
  
  <pre><code>Type type = new TypeToken&lt;List&lt;XYZ&gt;&gt;(){}.getType();
  List&lt;XYZ&gt; xyzList = gson.fromJson(jsonXyz, type); 
  </code></pre>
  
  <p>Is there a way to do the same with play.libs.Json.fromJson ?</p>
  
  <p>Any help appreciated.</p>
  
  <p>Edit (17.12.2013):</p>
  
  <p>I did the following to work around the problem. I guess there is a better way, but I didn't found it.</p>
  
  <pre><code>List&lt;MyObject&gt; response = new ArrayList&lt;MyObject&gt;();
  Promise&lt;WS.Response&gt; result = WS.url(Configuration.getRestPrefix() + "myObjects").get();
  WS.Response res = result.get();
  JsonNode json = res.asJson();
  if (json != null) {
    for (JsonNode jsonNode : json) {
      if (jsonNode.isArray()) {
        for (JsonNode jsonNodeInner : jsonNode) {
          MyObject mobj = Json.fromJson(jsonNodeInner, MyObject.class);
          response.add(bst);
        }
      } else {
        MyObject mobj = Json.fromJson(jsonNode, MyObject.class);
        response.add(bst);
      }
    }
  }
  return response;
  </code></pre>