Package com.facebook.presto.jdbc.internal.jackson.databind

Examples of com.facebook.presto.jdbc.internal.jackson.databind.JsonNode


    @Override
    public JsonNode path(String fieldName)
    {
        if (_children != null) {
            JsonNode n = _children.get(fieldName);
            if (n != null) {
                return n;
            }
        }
        return MissingNode.getInstance();
View Full Code Here


    public ObjectNode with(String propertyName)
    {
        if (_children == null) {
            _children = _createMap();
        } else {
            JsonNode n = _children.get(propertyName);
            if (n != null) {
                if (n instanceof ObjectNode) {
                    return (ObjectNode) n;
                }
                throw new UnsupportedOperationException("Property '"+propertyName
                        +"' has value that is not of type ObjectNode (but "
                        +n.getClass().getName()+")");
            }
        }
        ObjectNode result = objectNode();
        _children.put(propertyName, result);
        return result;
View Full Code Here

    public ArrayNode withArray(String propertyName)
    {
        if (_children == null) {
            _children = _createMap();
        } else {
            JsonNode n = _children.get(propertyName);
            if (n != null) {
                if (n instanceof ArrayNode) {
                    return (ArrayNode) n;
                }
                throw new UnsupportedOperationException("Property '"+propertyName
                        +"' has value that is not of type ArrayNode (but "
                        +n.getClass().getName()+")");
            }
        }
        ArrayNode result = arrayNode();
        _children.put(propertyName, result);
        return result;
View Full Code Here

        if (_children != null) {
            for (Map.Entry<String, JsonNode> entry : _children.entrySet()) {
                if (fieldName.equals(entry.getKey())) {
                    return entry.getValue();
                }
                JsonNode value = entry.getValue().findValue(fieldName);
                if (value != null) {
                    return value;
                }
            }
        }
View Full Code Here

        if (_children != null) {
            for (Map.Entry<String, JsonNode> entry : _children.entrySet()) {
                if (fieldName.equals(entry.getKey())) {
                    return this;
                }
                JsonNode value = entry.getValue().findParent(fieldName);
                if (value != null) {
                    return (ObjectNode) value;
                }
            }
        }
View Full Code Here

    {
        if (_children == null) {
            _children = _createMap();
        }
        for (Map.Entry<String, JsonNode> en : properties.entrySet()) {
            JsonNode n = en.getValue();
            if (n == null) {
                n = nullNode();
            }
            _children.put(en.getKey(), n);
        }
View Full Code Here

            return false;
        }
        if (_children != null) {
            for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
                String key = en.getKey();
                JsonNode value = en.getValue();
                JsonNode otherValue = other.get(key);
                if (otherValue == null || !otherValue.equals(value)) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

    @Override
    public JsonNode findValue(String fieldName)
    {
        if (_children != null) {
            for (JsonNode node : _children) {
                JsonNode value = node.findValue(fieldName);
                if (value != null) {
                    return value;
                }
            }
        }
View Full Code Here

    @Override
    public ObjectNode findParent(String fieldName)
    {
        if (_children != null) {
            for (JsonNode node : _children) {
                JsonNode parent = node.findParent(fieldName);
                if (parent != null) {
                    return (ObjectNode) parent;
                }
            }
        }
View Full Code Here

    /**
     * Method called to create a new context for iterating all
     * contents of the current structured value (JSON array or object)
     */
    public final NodeCursor iterateChildren() {
        JsonNode n = currentNode();
        if (n == null) throw new IllegalStateException("No current node");
        if (n.isArray()) { // false since we have already returned START_ARRAY
            return new Array(n, this);
        }
        if (n.isObject()) {
            return new Object(n, this);
        }
        throw new IllegalStateException("Current node of type "+n.getClass().getName());
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.jdbc.internal.jackson.databind.JsonNode

Copyright © 2018 www.massapicom. 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.