Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.fieldNames()


                            final JsonNode resultTree = new ObjectMapper().readTree(response.getResponseBody());
                            final String clusterName = resultTree.get("cluster_name").textValue();
                            final JsonNode nodesList = resultTree.get("nodes");

                            final Iterator<String> nodes = nodesList.fieldNames();
                            while (nodes.hasNext()) {
                                final String id = nodes.next();
                                final Version clusterVersion = Version.fromString(nodesList.get(id).get("version").textValue());

                                if (!configuration.isEsDisableVersionCheck()) {
View Full Code Here


    public Link deserialize(JsonParser jsonParser,
                            DeserializationContext deserializationContext) throws IOException, JsonProcessingException {

        ObjectCodec oc = jsonParser.getCodec();
        JsonNode node = oc.readTree(jsonParser);
        String rel = node.fieldNames().next();
        String href = node.elements().next().get("href").textValue();


        return new Link(rel,href);
    }
View Full Code Here

            classConfig = node.get(tmp);
           
            try {
                type = Class.forName(tmp, false, loader);
                typeBinder = binder.instance(type);
                names = classConfig.fieldNames();
               
                if (names.hasNext()) {
                    tmp = names.next();
                    typeNode = classConfig.get(tmp);
                   
View Full Code Here

            json = json.get("attributes");
            if (json != null) {
                final Iterator<JsonNode> nodes = json.iterator();
                while (nodes.hasNext()) {
                    json = nodes.next();
                    final String attribute = json.fieldNames().next();
                    userProfile.addAttribute(attribute, JsonHelper.get(json, attribute));
                }
            }
        }
        return userProfile;
View Full Code Here

  @Override
  public Tuple transformPayload(String json) throws Exception {
    List<String> names = new ArrayList<String>();
    List<Object> values = new ArrayList<Object>();
    JsonNode node = this.mapper.readTree(json);
    Iterator<String> fieldNames = node.fieldNames();
    while (fieldNames.hasNext()) {
      String name = fieldNames.next();
      JsonNode valueNode = node.get(name);
      Object value = mapper.treeToValue(valueNode, Object.class);
      names.add(name);
View Full Code Here

       
          String[] names = new String[dataNode.size()];
          Number[] values = new Number[dataNode.size()];
         
          int index = 0;
          Iterator<String> fieldIterator = dataNode.fieldNames();
          while(fieldIterator.hasNext()) {
            String field = fieldIterator.next();
            names[index] = field;
            values[index] = dataNode.get(field).numberValue();
            index++;
View Full Code Here

    {
        if (additionalOK)
            return;

        final JsonNode instance = data.getInstance().getNode();
        final Set<String> fields = Sets.newHashSet(instance.fieldNames());

        fields.removeAll(properties);

        final Set<String> tmp = Sets.newHashSet();
View Full Code Here

        final ObjectNode ret = FACTORY.objectNode();
        final ArrayNode required = FACTORY.arrayNode();
        ret.put("required", required);

        final JsonNode node = schema.get(keyword);
        final List<String> list = Lists.newArrayList(node.fieldNames());

        Collections.sort(list);

        for (final String field: list)
            if (node.get(field).path("required").asBoolean(false))
View Full Code Here

        final ProcessingReport report, final MessageBundle bundle,
        final FullData data)
        throws ProcessingException
    {
        final JsonNode instance = data.getInstance().getNode();
        final Set<String> fields = Sets.newHashSet(instance.fieldNames());

        Collection<String> collection;
        Set<String> set;

        for (final String field: propertyDeps.keySet()) {
View Full Code Here

        try
        {
            JsonNode jsonNode = objectMapper.readTree(inputStream);
            T value = objectMapper.convertValue(jsonNode,type);

            return new RequestContext<T>(value,jsonNode.fieldNames());
        }
        catch (Exception e)
        {
            throw new BadRequestException(String.format("Error unmarshalling request: %s",e.getMessage()),e);
        }
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.