Package com.fasterxml.jackson.databind

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


      Iterator<Entry<String, JsonNode>> catIter = structured.fields();
      while (catIter.hasNext()) {
        Entry<String, JsonNode> catEntry = catIter.next();
        String catName = catEntry.getKey();
        JsonNode catNode = catEntry.getValue();
        Iterator<Entry<String, JsonNode>> propIter = catNode.fields();
        while (propIter.hasNext()) {
          Entry<String, JsonNode> propEntry = propIter.next();
          String propName = propEntry.getKey();
          int magnitude = propEntry.getValue().asInt();
          // TODO Maybe we should be using a String[2] instead of
View Full Code Here


                                         final DeserializationContext context)
            throws IOException {
        final LocalizedBuilder<Object> builder = new LocalizedBuilder<>();
        final ObjectCodec codec = parser.getCodec();
        final JsonNode node = codec.readTree(parser);
        final Iterator<Map.Entry<String, JsonNode>> iterator = node.fields();
        while (iterator.hasNext()) {
            final Map.Entry<String, JsonNode> entry = iterator.next();
            builder.setValue(
                    Locale.forLanguageTag(entry.getKey()),
                    entry.getValue().textValue());
View Full Code Here

                JsonNode content = entry.getValue();
                String id = entry.getKey();
                Map<String, String> entryMetadata = new HashMap<>();

                // We then iterate over all the key-value pairs present in the children node, and store them.
                for (Iterator<Map.Entry<String, JsonNode>> properties = content.fields();
                     properties.hasNext(); ) {
                    Map.Entry<String, JsonNode> property = properties.next();
                    String entryName = property.getKey();
                    JsonNode entryValueNode = property.getValue();
View Full Code Here

                        entryMetadata.put(entryName, entryValue);
                    }

                    // We get environment variables from the metadata when we iterate over app.env
                    if (id.equals("app") && entryName.equals("env")) {
                        for (Iterator<Map.Entry<String, JsonNode>> envVariables = entryValueNode.fields();
                             envVariables.hasNext(); ) {
                            Map.Entry<String, JsonNode> envVariable = envVariables.next();
                            String envName = envVariable.getKey();
                            JsonNode envValue = envVariable.getValue();
                            if (envValue.isTextual()) {
View Full Code Here

    @Override
    protected void _depositSchemaProperty(ObjectNode propertiesNode, JsonNode schemaNode)
    {
        JsonNode props = schemaNode.get("properties");
        if (props != null) {
            Iterator<Entry<String, JsonNode>> it = props.fields();
            while (it.hasNext()) {
                Entry<String,JsonNode> entry = it.next();
                String name = entry.getKey();
                if (_nameTransformer != null) {
                    name = _nameTransformer.transform(name);
View Full Code Here

                    createIndex.setSettings(jsonMapper.writeValueAsString(indexSettings));
                }

                JsonNode mappings = indexConfig.get("mappings");
                if (mappings != null && mappings.isObject()) {
                    for (Iterator<Map.Entry<String, JsonNode>> i = mappings.fields(); i.hasNext(); ) {
                        Map.Entry<String, JsonNode> field = i.next();
                        ObjectNode mapping = jsonMapper.createObjectNode();
                        mapping.put(field.getKey(), field.getValue());
                        createIndex.addMapping(field.getKey(), jsonMapper.writeValueAsString(mapping));
                    }
View Full Code Here

      if (channel != null) {
        channel.position(0);
      }
      properties.clear();
      final JsonNode data = om.readTree(fis);
      final Iterator<Entry<String, JsonNode>> fieldIter = data.fields();
     
      while (fieldIter.hasNext()) {
        final Entry<String, JsonNode> item = fieldIter.next();
        properties.put(item.getKey(), item.getValue());
      }
View Full Code Here

    Map<String, JsonNode> newProps = new LinkedHashMap<String, JsonNode>();
    newProps.put( "@type", new TextNode( type ) );
    newProps.put( "@version", new TextNode( version.format() ) );

    Iterator<Map.Entry<String, JsonNode>> nodeIterator = tree.fields();
    while ( nodeIterator.hasNext() ) {
      Map.Entry<String, JsonNode> jsonNode = nodeIterator.next();
      newProps.put( jsonNode.getKey(), jsonNode.getValue() );
    }
View Full Code Here

        }
    }

    private void putFieldNames(DBObject dbo, JsonNode node) {
        JsonNode properties = node.get("properties");
        Iterator<Map.Entry<String, JsonNode>> fields = properties.fields();
        while (fields.hasNext()) {
            Map.Entry<String, JsonNode> field = fields.next();
            String fieldName = field.getKey();
            JsonNode value = field.getValue();
            if (value.has("properties")) {
View Full Code Here

      if (channel != null) {
        channel.position(0);
      }
      properties.clear();
      JsonNode data = om.readTree(fis);
      Iterator<Entry<String, JsonNode>> fieldIter = data.fields();
     
      while (fieldIter.hasNext()) {
        Entry<String, JsonNode> item = fieldIter.next();
        properties.put(item.getKey(), item.getValue());
      }
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.