title: Deserialization of arrays with Jackson
body: <p>i have something like JSON-RPC client, and i´m having trouble deserializing
  incoming json string into my java object.
  The incoming json format is:</p>
  
  <pre><code>{"value":"xxxx","type":"xxxx"}
  </code></pre>
  
  <p>The object i want to deserialize to:</p>
  
  <pre><code>@JsonAutoDetect
  @JsonDeserialize()
  public class ReturnValue {
  
  private Object value;
  private String type;
  
  @JsonCreator
  public ReturnValue(@JsonProperty("value") String val, @JsonProperty("type") String type) {
      value = val;
      this.type = type;
  }
  
  ...getters, setters...
  </code></pre>
  
  <p>This seems to work ok, if the value is String, but if it´s of array type, it throws
  JsonMapping Exception - Can not deserialize instance of java.lang.String out of START_ARRAY token
  for the json like this:</p>
  
  <pre><code>{\"value\":[8, 10], \"type\":\"[int]\"}
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>int[] arr = (int[])getReturnValue(jsonString).getValue();
  </code></pre>
  
  <p>Where getReturnValue is nothing special:</p>
  
  <pre><code>    ObjectMapper om = new ObjectMapper();
      ReturnValue rv = null;
      rv = om.readValue(json, ReturnValue.class);
      return rv;
  </code></pre>
  
  <p>The another problem is that i would want the type property to be of Class type, but this would throw
  another mapping exception. Is there any way in Jackson to do it, or do i have to convert from string to appropriate class myself. Thank you for any advice.</p>