title: Deserializing Guava's Table with Jackson throws "JsonMappingException: No suitable constructor found for type"
body: <p>I'm using <code>jackson-datatype-guava</code>. I'm trying to deserialize a Table from JSON, but I'm getting an exception.</p>
  
  <p>My code is:</p>
  
  <pre><code>@Test
  public void jsonTable() throws IOException {
      Table&lt;String, String, String&gt; table = HashBasedTable.create();
      table.put("row1", "col1", "cell11");
      table.put("row1", "col2", "cell12");
      table.put("row2", "col1", "cell21");
      table.put("row2", "col2", "cell22");
  
      ObjectMapper mapper = new ObjectMapper()
              .registerModule(new GuavaModule());
  
      String tableJson = mapper.writeValueAsString(table);
      System.out.println(tableJson);
  
      Table&lt;String, String, String&gt; deserializedTable = mapper.readValue(tableJson, HashBasedTable.class);
  }
  </code></pre>
  
  <p>The exception thrown at the last line is:</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class com.google.common.collect.HashBasedTable]: can not instantiate from JSON object (missing default constructor or creator, or perhaps need to add/enable type information?)
   at [Source: {"row1":{"col2":"cell12","col1":"cell11"},"row2":{"col2":"cell22","col1":"cell21"}}; line: 1, column: 2]
      at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:255)
      at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1130)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:298)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:133)
      at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3807)
      at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2797)
      at com.gk.dfm.repository.impl.JsonTableTest.jsonTable(JsonTableTest.java:31)
  </code></pre>
  
  <p>It makes sense, since HashBasedTable has no default constructor. We should construct it using <code>HashBasedTable.create()</code>. How can I tell it to Jackson though?</p>
  
  <p>On <a href="http://www.leveluplunch.com/java/examples/convert-json-to-guava-multimap-with-jackson/" rel="nofollow">this page</a> I found how to deserialize Guava's Multimap:</p>
  
  <pre><code>@Test
  public void convert() throws JsonParseException, JsonMappingException,
          JsonProcessingException, IOException {
  
      ObjectMapper objectMapper = new ObjectMapper();
      objectMapper.registerModule(new GuavaModule());
  
      Multimap&lt;String, NavItem&gt; navs = objectMapper.readValue(
              objectMapper.treeAsTokens(objectMapper.readTree(jsonString)),
              objectMapper.getTypeFactory().constructMapLikeType(
                      Multimap.class, String.class, NavItem.class));
  
      logger.info(navs);
  
      assertThat(navs.keys(), hasItems("123455", "999999"));
  }
  </code></pre>
  
  <p>How can I apply it to a Table? There is no such thing as constructTableLikeType.</p>