Examples of treeToValue()


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

                    }
                    if (clazz.equals(Float.class)) {
                        val = (float)arg.doubleValue();
                    }
                }
                val = mapper.treeToValue(arg, clazz);
                args.add(val);
            }
            return result;
        }
View Full Code Here

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

            if (args != null) {
                Iterator<JsonNode> iterator = args.elements();
                if (iterator.hasNext()) {
                    JsonNode node = iterator.next();
                    Class<?> eventClass = eventMapping.get(eventName);
                    Object arg = mapper.treeToValue(node, eventClass);
                    eventArgs.add(arg);
                    while (iterator.hasNext()) {
                        node = iterator.next();
                        arg = mapper.treeToValue(node, Object.class);
                        eventArgs.add(arg);
View Full Code Here

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

                    Class<?> eventClass = eventMapping.get(eventName);
                    Object arg = mapper.treeToValue(node, eventClass);
                    eventArgs.add(arg);
                    while (iterator.hasNext()) {
                        node = iterator.next();
                        arg = mapper.treeToValue(node, Object.class);
                        eventArgs.add(arg);
                    }
                }
            }
            return event;
View Full Code Here

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

                    }
                    if (clazz.equals(Float.class)) {
                        val = (float)arg.doubleValue();
                    }
                }
                val = mapper.treeToValue(arg, clazz);
                args.add(val);
            }
            return result;
        }
View Full Code Here

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

            if (args != null) {
                Iterator<JsonNode> iterator = args.elements();
                if (iterator.hasNext()) {
                    JsonNode node = iterator.next();
                    Class<?> eventClass = eventMapping.get(eventName);
                    Object arg = mapper.treeToValue(node, eventClass);
                    eventArgs.add(arg);
                    while (iterator.hasNext()) {
                        node = iterator.next();
                        arg = mapper.treeToValue(node, Object.class);
                        eventArgs.add(arg);
View Full Code Here

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

                    Class<?> eventClass = eventMapping.get(eventName);
                    Object arg = mapper.treeToValue(node, eventClass);
                    eventArgs.add(arg);
                    while (iterator.hasNext()) {
                        node = iterator.next();
                        arg = mapper.treeToValue(node, Object.class);
                        eventArgs.add(arg);
                    }
                }
            }
            return event;
View Full Code Here

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

      TreeNode node = jp.readValueAsTree();
   
    if (node instanceof ObjectNode) {
        // not clean, but has to do...
            ObjectMapper mapper = (ObjectMapper) jp.getCodec();
      JsonSchema innerSchema = mapper.treeToValue(node, JsonSchema.class);
      return new ArraySchema.SchemaAdditionalItems(innerSchema);
    }
    if (node instanceof BooleanNode) {
      BooleanNode booleanNode = (BooleanNode) node;
      if (booleanNode.booleanValue()) {
View Full Code Here

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

                JsonNode arg = iter.next();
                if (arg.isTextual() || arg.isBoolean()) {
                    clazz = Object.class;
                }

                val = mapper.treeToValue(arg, clazz);
                args.add(val);
                i++;
            }
            return result;
        }
View Full Code Here

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

                    if (i > eventClasses.size() - 1) {
                        log.debug("Event {} has more args than declared in handler: {}", eventName, root);
                        break;
                    }
                    Class<?> eventClass = eventClasses.get(i);
                    Object arg = mapper.treeToValue(node, eventClass);
                    eventArgs.add(arg);
                    i++;
                }
            }
            return event;
View Full Code Here

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

                    JsonNode settingsNode = outputWriterNode.path("settings");
                    if (settingsNode.isMissingNode()) {
                    } else if (settingsNode.isObject()) {
                        ObjectMapper mapper = new ObjectMapper();
                        @SuppressWarnings("unchecked")
                        Map<String, Object> settings = mapper.treeToValue(settingsNode, Map.class);
                        outputWriter.setSettings(settings);
                        if (settings.containsKey("enabled")) {
                            outputWriter.setEnabled(Boolean.valueOf(String.valueOf(settings.get("enabled"))));
                        }
                    } else {
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.