Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.ObjectMapper.convertValue()


   */
  public Object getParam(final String name) {
    final ObjectMapper mapper = JOM.getInstance();
    final ObjectNode params = req.with(PARAMS);
    if (params.has(name)) {
      return mapper.convertValue(params.get(name), Object.class);
    }
    return null;
  }
 
  /**
 
View Full Code Here


   *            the new data
   */
  public final void setData(final Object data) {
    final ObjectMapper mapper = JOM.getInstance();
    error.put(DATA_S,
        data != null ? mapper.convertValue(data, JsonNode.class) : null);
  }
 
  /**
   * Gets the data.
   *
 
View Full Code Here

   */
  public void setResult(final Object result) {
    if (result != null) {
      final ObjectMapper mapper = JOM.getInstance();
      resp.put(RESULT,
          (JsonNode) mapper.convertValue(result, JSONNODETYPE));
      setError(null);
    } else {
      if (resp.has(RESULT)) {
        resp.remove(RESULT);
      }
View Full Code Here

   *            the new data
   */
  public final void setData(final Object data) {
    final ObjectMapper mapper = JOM.getInstance();
    error.put(DATA_S,
        data != null ? mapper.convertValue(data, JsonNode.class) : null);
  }
 
  /**
   * Gets the data.
   *
 
View Full Code Here

   * @param result the new result
   */
  public void setResult(final Object result) {
    if (result != null) {
      final ObjectMapper mapper = JOM.getInstance();
      resp.put(RESULT, mapper.convertValue(result, JsonNode.class));
      setError(null);
    } else {
      if (resp.has(RESULT)) {
        resp.remove(RESULT);
      }
View Full Code Here

    if (value instanceof JsonNode) {
      if (((JsonNode) value).isNull()) {
        return null;
      }
      try {
        return mapper.convertValue(value, fullType);
      } catch (final Exception e) {
        ClassCastException cce = new ClassCastException("Failed to convert value:" + value
            + " -----> " + fullType);
        cce.initCause(e);
        throw cce;
View Full Code Here

   * @param name the name
   * @param value the value
   */
  public void putParam(final String name, final Object value) {
    final ObjectMapper mapper = JOM.getInstance();
    req.with(PARAMS).put(name, mapper.convertValue(value, JsonNode.class));
  }
 
  /**
   * Gets the param.
   *
 
View Full Code Here

   */
  public Object getParam(final String name) {
    final ObjectMapper mapper = JOM.getInstance();
    final ObjectNode params = req.with(PARAMS);
    if (params.has(name)) {
      return mapper.convertValue(params.get(name), Object.class);
    }
    return null;
  }
 
  /**
 
View Full Code Here

    setError(error);
  }
 
  public void setId(Object id) {
    ObjectMapper mapper = JOM.getInstance();
    resp.put("id", mapper.convertValue(id, JsonNode.class));
  }

  public Object getId() {
    ObjectMapper mapper = JOM.getInstance();
    return mapper.convertValue(resp.get("id"), JsonNode.class);
View Full Code Here

    resp.put("id", mapper.convertValue(id, JsonNode.class));
  }

  public Object getId() {
    ObjectMapper mapper = JOM.getInstance();
    return mapper.convertValue(resp.get("id"), JsonNode.class);
  }

  public void setResult(Object result) {
    if (result != null) {
      ObjectMapper mapper = JOM.getInstance();
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.