title: How can I make Jackson deserialize a Long to a Date Object?
body: <p>I'm serializing some java.util.Dates within a Map. The dates are serialized into Longs (Jackson writes the <code>Long</code> value of the <code>Date</code> instance to the JSON string), however, they're not being de-serialized back to <code>Date</code> instances, but as <code>Long</code> instances. </p>
  
  <p>I'd like Jackson to de-serialize the dates back to Date objects (rather than formatted Strings or Longs), how can I achieve this?</p>
  
  <pre><code>Map&lt;String, Comparable&lt;?&gt;&gt; change = new HashMap&lt;String, Comparable&lt;?&gt;&gt;();
      change.put("DESCRIPTION", "LIBOR");
      change.put("RATE", "1.8");
      change.put("DATE", Util.newDate(2009, 7, 1)); // Returns a java.util.Date
  </code></pre>
  
  <p>Produces</p>
  
  <pre><code>{"DESCRIPTION":"LIBOR"},{"RATE":"1.8"},{"DATE":1246402800000}, ... }
  </code></pre>
  
  <p>Which is okay. However, the date String is deserialized (inflated) back into an instance of <code>java.lang.Long</code>, when I want it to be an instance of <code>java.util.Date</code> - which is what it started as. 
  i.e. <code>Map change</code> now contains three entries; Description as a <code>String</code>, Rate as a <code>Float</code> and Date as a <code>Long</code>. </p>