title: Jackson "no single-String constructor/factory method" exception
body: <p>I have an entity:</p>
  
  <pre><code>E{
      String screen;
  }
  </code></pre>
  
  <p>I need to assign screen-field to one of the values that I receive as a json string</p>
  
  <blockquote>
    <p>"screen":{"ldpi":"1.jpg","mdpi":"2.jpg","hdpi":"3.jpg","xhdpi":"4.jpg"}</p>
  </blockquote>
  
  <p>Unfortunately I can't declare container class instead of just string since E class is used by an orm system.</p>
  
  <p>In order to achieve it I created custom value-deserializer:</p>
  
  <pre><code>public class DensityDeserializer extends JsonDeserializer&lt;String&gt; {
  
      public final static int LDPI = 0;
      public final static int MDPI = 1;
      public final static int HDPI = 2;
      public final static int XHDPI = 3;
  
      private int mDensity = LDPI;
  
      public DensityDeserializer() {
      }
  
      public DensityDeserializer(int density) {
          mDensity = density;
      }
  
      @Override
      public String deserialize(JsonParser jsonparser,
              DeserializationContext deserializationcontext) throws IOException,
              JsonProcessingException {
          ScreenContainer screenContainer = jsonparser
                  .readValueAs(ScreenContainer.class);
          switch (mDensity) {
          default:
              return "";
          case LDPI:
              return screenContainer.getLdpi();
          case MDPI:
              return screenContainer.getHdpi();
          case HDPI:
              return screenContainer.getHdpi();
          case XHDPI:
              return screenContainer.getXhdpi();
          }
      }
  
      public static class ScreenContainer {
          public String ldpi = "";
          public String mdpi = "";
          public String hdpi = "";
          public String xhdpi = "";
  
          public ScreenContainer() {
              // TODO Auto-generated constructor stub
          }
  
          public String getLdpi() {
              return ldpi;
          }
  
          public void setLdpi(String ldpi) {
              this.ldpi = ldpi;
          }
  
          public String getMdpi() {
              return mdpi;
          }
  
          public void setMdpi(String mdpi) {
              this.mdpi = mdpi;
          }
  
          public String getHdpi() {
              return hdpi;
          }
  
          public void setHdpi(String hdpi) {
              this.hdpi = hdpi;
          }
  
          public String getXhdpi() {
              return xhdpi;
          }
  
          public void setXhdpi(String xhdpi) {
              this.xhdpi = xhdpi;
          }
      }
  }
  </code></pre>
  
  <p>When I run the program it throws an exception: </p>
  
  <blockquote>
    <p>01-11 12:29:06.833: W/System.err(1501): com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class .DensityDeserializer$ScreenContainer] from JSON String; no single-String constructor/factory method (through reference chain: E.["screen"])</p>
  </blockquote>
  
  <p>Any suggestions ?</p>