Examples of valueToTree()


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

  }

  public Object mapJavaToInternal(Object parameter) {
    ObjectMapper mapper = format.getConfiguredObjectMapper();
    try {
      return mapper.valueToTree(parameter);
    } catch (IllegalArgumentException e) {
      throw LOG.unableToMapInput(parameter, e);
    }
  }
View Full Code Here

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

   * @return the serializable
   */
  public synchronized Serializable locPut(final String key,
      final Serializable value) {
    final ObjectMapper om = JOM.getInstance();
    locPut(key, om.valueToTree(value));
    return value;
  }
 
  /**
   * Loc put if unchanged.
View Full Code Here

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

   * @return true, if successful
   */
  public boolean locPutIfUnchanged(final String key,
      final Serializable newVal, final Serializable oldVal) {
    final ObjectMapper om = JOM.getInstance();
    return locPutIfUnchanged(key, om.valueToTree(newVal),
        om.valueToTree(oldVal));
  }
 
  /*
   * (non-Javadoc)
 
View Full Code Here

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

   */
  public boolean locPutIfUnchanged(final String key,
      final Serializable newVal, final Serializable oldVal) {
    final ObjectMapper om = JOM.getInstance();
    return locPutIfUnchanged(key, om.valueToTree(newVal),
        om.valueToTree(oldVal));
  }
 
  /*
   * (non-Javadoc)
   *
 
View Full Code Here

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

 
  protected JsonNode updatePayloadFieldValue(String sPayload, String sFieldName, String[] values)
  {
    JsonNode node = getPayload(sPayload);
    ObjectMapper mapper = new ObjectMapper();
    ArrayNode array = mapper.valueToTree(Arrays.asList(values));
    ((ObjectNode)node).putArray(sFieldName).addAll(array);
    return node;
  }
 
  protected byte[] getResource(String sName)
View Full Code Here

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

    ObjectMapper mapper = new ObjectMapper();
      result.put("result", "error");
      result.put("message", error);
      result.put("resource", request.path());
      result.put("method", request.method());
      result.put("request_header", (JsonNode)mapper.valueToTree(request.headers()));
      result.put("API_version", BBConfiguration.configuration.getString(BBConfiguration.API_VERSION));
      setCallIdOnResult(request, result);
    return result;
  }
   
View Full Code Here

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

        Method getter = new PropertyDescriptor(propertyName, classWithFormattedProperties).getReadMethod();

        assertThat(getter.invoke(pojo).toString(), is(equalTo(javaValue.toString())));

        JsonNode jsonVersion = objectMapper.valueToTree(pojo);

        assertThat(jsonVersion.get(propertyName).asText(), is(equalTo(jsonValue.toString())));

    }
View Full Code Here

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

   * @return the serializable
   */
  public synchronized Serializable locPut(final String key,
      final Serializable value) {
    final ObjectMapper om = JOM.getInstance();
    locPut(key, om.valueToTree(value));
    return value;
  }
 
  /**
   * Loc put if unchanged.
View Full Code Here

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

   * @return true, if successful
   */
  public boolean locPutIfUnchanged(final String key,
      final Serializable newVal, final Serializable oldVal) {
    final ObjectMapper om = JOM.getInstance();
    return locPutIfUnchanged(key, om.valueToTree(newVal),
        om.valueToTree(oldVal));
  }
 
  /* (non-Javadoc)
   * @see java.lang.Object#toString()
View Full Code Here

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

   */
  public boolean locPutIfUnchanged(final String key,
      final Serializable newVal, final Serializable oldVal) {
    final ObjectMapper om = JOM.getInstance();
    return locPutIfUnchanged(key, om.valueToTree(newVal),
        om.valueToTree(oldVal));
  }
 
  /* (non-Javadoc)
   * @see java.lang.Object#toString()
   */
 
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.