title: java/jackson - @JsonValue/@JsonCreator and null
body: <p>I have a <code>Value</code> class which holds a value:</p>
  
  <pre><code>public class Value {
      protected final Object value;
  
      @JsonValue
      public Object getValue() {
          return value;
      }
  
      @JsonCreator
      public Value(final Object value) {
          this.value = value;
      }
  }
  </code></pre>
  
  <p>This <code>Value</code> class is embedded as a field (amongst other fields) in a data class:</p>
  
  <pre><code>class Data {
      protected final Value value;
  
      @JsonProperty("value")
      public Value getValue() {
          return value;
      }
  
      ...
  
      @JsonCreator
      public Data(@JsonProperty("value") final Value value, ...) {
          this.value = value;
          ....
      }
  }
  </code></pre>
  
  <p>When the input JSON has <code>null</code> for the <code>value</code> field of a <code>data</code> object (see below for example), <code>Data.value</code> is null. I would like to have <code>Data.value</code> set to <code>new Value(null)</code>. In other words, the data object must hold a non-null value object, which holds the null.</p>
  
  <pre><code>{
    "value" : null,
    ...
  }
  </code></pre>
  
  <p>What is the easiest way to achieve this? I could ofcourse alter the constructor of <code>Data</code>, but I am wondering if Jackson could resolve this automatically.</p>