title: Generic object serialization in Jackson with Java
body: <p>I would like to read in the string   <code>{"a": 1.0}</code>  as a generic Java Object while keeping the same string format. However, when I try, Jackson automatically changes the internal representation to <code>{a = 1}</code>. In other words, how can I get the following code to print <code>{"a": 1.0}</code> instead of <code>{a = 1}</code>? Note that, I have to read it in as an <code>Object</code> (due to other program constraints). </p>
  
  <pre><code>import org.codehaus.jackson.map.ObjectMapper;
  
  public class Main {
  
      public static void main(String[] args) {
          try
      {
              ObjectMapper mapper = new ObjectMapper();
              Object myObject = mapper.readValue("{\"a\": 1.0}", Object.class);
              System.out.println(myObject.toString());            
      }
      catch (Exception e)
      {
          e.printStackTrace();
        System.err.println(e.getMessage()); 
      }
      }
  
  }
  </code></pre>