title: JsonNode to object?
body: <p>I am writing a <code>JsonDeserialzer</code> for a POJO class <code>Attribute</code>:</p>
  
  <pre><code>public class AttributeDeserializer extends JsonDeserializer&lt;Attribute&gt; {
  
          @Override
          public Attribute deserialize(JsonParser jp, DeserializationContext ctxt) 
            throws IOException, JsonProcessingException {
  
              JsonNode node = jp.getCodec().readTree(jp);
  
              String name =  node.get("name").asText();
  
              //String value = node.get("value").asText();
  
              Attribute attr = new Attribute();
              attr.setName(name);
              attr.setValue(value);
  
              return attr;
          }
  </code></pre>
  
  <p><code>Attribute</code> class has two variables <code>name</code> and <code>value</code> where name is <code>String</code> type and value is <code>Object</code> type.</p>
  
  <p>I know to get the String value from <code>JsonNode</code> using </p>
  
  <pre><code>node.get("name").asText()
  </code></pre>
  
  <p>, but value being <code>Object</code> type it can be a List, String or anything.</p>
  
  <p>How shall I create the <code>Attribute</code> object in the deserialzer ?? </p>
  
  <p>Attribute class:</p>
  
  <pre><code>public class Attribute {
  
      protected String name;
      protected Object value;
  
      public String getName() {
          return name;
      }
      public void setName(String value) {
          this.name = value;
      }
  
      public Object getValue() {
          return value;
      }
      public void setValue(Object value) {
          this.value = value;
      }
  
  }
  </code></pre>