title: Parsing an array of JSON objects using Jackson 2.0
body: <p>I am in the process of upgrading Jackson from 1.9.4 to 2.2.0. The transition has been smooth, except I can't seem to get array parsing for Objects working. In 1.9.4 I could do this:</p>
  
  <pre><code>private List&lt;Subjects&gt; mSubjects;
  mSubjects = objectMapper.readValue(subjectsJsonArrayNode, new TypeReference&lt;List&lt;Subjects&gt;&gt;() {});
  </code></pre>
  
  <p>With Jackson 2.2.0, I get a "cannot resolve method" compile-time error. Jackson's ObjectMapper header file for 1.9.4 contains these readValue methods for JsonNodes:</p>
  
  <pre><code>public &lt;T&gt; T readValue(JsonNode root, java.lang.Class&lt;T&gt; valueType)
  public &lt;T&gt; T readValue(JsonNode root, org.codehaus.jackson.type.TypeReference valueTypeRef)
  public &lt;T&gt; T readValue(JsonNode root, org.codehaus.jackson.type.JavaType valueType)
  </code></pre>
  
  <p>And Jackson 2.2.0's header file:</p>
  
  <pre><code>public &lt;T&gt; T readValue(JsonParser jsonParser, java.lang.Class&lt;T&gt; tClass)
  public &lt;T&gt; T readValue(JsonParser jsonParser, com.fasterxml.jackson.core.type.TypeReference&lt;?&gt; typeReference)
  public final &lt;T&gt; T readValue(JsonParser jsonParser, com.fasterxml.jackson.core.type.ResolvedType resolvedType)
  public &lt;T&gt; T readValue(JsonParser jsonParser, com.fasterxml.jackson.databind.JavaType javaType) 
  </code></pre>
  
  <p>So I need to switch from passing a JsonNode to a JsonParser, but I'm not quite sure how to make that transition. That said, I'm not sure if I'm even going down the right path because JsonParser is defined as an abstract class so I can't even easily initialize an instance to play around with it. </p>
  
  <p>For those who come without an answer, here is a temporary solution I have in place where I iterate and manually parse each object:</p>
  
  <pre><code> private List&lt;Subjects&gt; mSubjects = new ArrayList&lt;Subjects&gt;();
   for(JsonNode subjectJsonNode : subjectsJsonArrayNode) {
      mSubjects.add(objectMapper.treeToValue(subjectJsonNode, Subject.class));
   }
  </code></pre>