title: morphia handle bad data
body: <p>Let's say I have some json like this in mongo:</p>
  
  <pre><code>{"n":"5"}
  </code></pre>
  
  <p>and a java class like this:</p>
  
  <pre><code>@Entity 
  public class Example {
      Integer n;
  }
  </code></pre>
  
  <p>This works (I know that the json should store the value as an int not a string but I don't control that part).</p>
  
  <p>Now when I have data like this morphia throws:</p>
  
  <pre><code>{"n":""}
  </code></pre>
  
  <p>I'm looking for a workaround (the behavior I'd like is for empty string to be treated same as null).</p>
  
  <p>The only workaround I have so far is:</p>
  
  <pre><code>public class Example {
      String n;
  
      public Integer getN() {
          return NumberUtils.isNumber(n) ? NumberUtils.createInteger(n) : null;
      }
  }
  </code></pre>
  
  <p>But I'm hoping for some way to hang an annotation on the Integer property that customizes the deserialization behavior.</p>