Package org.codehaus.jackson.map

Examples of org.codehaus.jackson.map.ObjectMapper.treeToValue()


                return sourceString;
              } else {
                return mapper.readValue((String)source, javaType);
              }
            } else if (source instanceof JsonNode) {
                return mapper.treeToValue((JsonNode)source, context.getTargetDataType().getPhysical());
            } else if (source instanceof JsonParser) {
                return mapper.readValue((JsonParser)source, javaType);
            } else {
                return mapper.readValue(source.toString(), javaType);
            }
View Full Code Here


                return sourceString;
              } else {
                return mapper.readValue((String)source, javaType);
              }
            } else if (source instanceof JsonNode) {
                return mapper.treeToValue((JsonNode)source, context.getTargetDataType().getPhysical());
            } else if (source instanceof JsonParser) {
                return mapper.readValue((JsonParser)source, javaType);
            } else {
                return mapper.readValue(source.toString(), javaType);
            }
View Full Code Here

  public final <_Object_ extends Object> _Object_ decode (final Object data, final Class<_Object_> clasz)
  {
    try {
      final ObjectMapper mapper = new ObjectMapper ();
      final JsonNode node = this.encode (data);
      final _Object_ object = mapper.treeToValue (node, clasz);
      return (object);
    } catch (final IOException exception) {
      throw (new IllegalStateException (exception));
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.