Examples of treeToValue()


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

        ObjectMapper objectMapper = new ObjectMapper();

        ObjectNode node = objectMapper.createObjectNode();
        node.put(propertyName, jsonValue.toString());

        Object pojo = objectMapper.treeToValue(node, classWithFormattedProperties);

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

        assertThat(getter.invoke(pojo).toString(), is(equalTo(javaValue.toString())));
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()

                    }
                    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()

                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()

                    }
                    if (clazz.equals(Float.class)) {
                        val = (float)arg.doubleValue();
                    }
                }
                val = mapper.treeToValue(arg, clazz);
                args.add(val);
            }
            return result;
        }
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.