Package org.apache.isis.viewer.restfulobjects.applib.util

Examples of org.apache.isis.viewer.restfulobjects.applib.util.PathNode


    private JsonNode getNode(final String path) {
        JsonNode jsonNode = this.jsonNode;
        final List<String> keys = PathNode.split(path);
        for (final String key : keys) {
            final PathNode pathNode = PathNode.parse(key);
            if (!pathNode.getKey().isEmpty()) {
                jsonNode = jsonNode.path(pathNode.getKey());
            } else {
                // pathNode is criteria only; don't change jsonNode
            }
            if (jsonNode.isNull()) {
                return jsonNode;
            }
            if (!pathNode.hasCriteria()) {
                continue;
            }
            if (!jsonNode.isArray()) {
                return NullNode.getInstance();
            }
View Full Code Here


            return terminated();
        }
        if (mode == Mode.TERMINATED) {
            return terminated();
        }
        final PathNode candidate = PathNode.parse(path);
        if (mode == Mode.FOLLOWING) {
            List<List<PathNode>> remainingPathSpecs = Lists.newArrayList();
            List<PathNode> firstSpecs = Lists.newArrayList();
            for(List<PathNode> spec: pathSpecs) {
                if(spec.isEmpty()) {
                    continue;
                }
                PathNode first = spec.get(0);
                if(candidate.equals(first)) {
                    List<PathNode> remaining = spec.subList(1, spec.size());
                    firstSpecs.add(first);
                    remainingPathSpecs.add(remaining);
                }
View Full Code Here

    private NodeAndFormat getNodeAndFormat(final String path) {
        JsonNode jsonNode = this.jsonNode;
        final List<String> keys = PathNode.split(path);
        String format = null;
        for (final String key : keys) {
            final PathNode pathNode = PathNode.parse(key);
            if (!pathNode.getKey().isEmpty()) {
                // grab format (if present) before moving down the path
                format = getFormatValueIfAnyFrom(jsonNode);
                jsonNode = jsonNode.path(pathNode.getKey());
            } else {
                // pathNode is criteria only; don't change jsonNode
            }
            if (jsonNode.isNull()) {
                return new NodeAndFormat(jsonNode, format);
            }
            if (!pathNode.hasCriteria()) {
                continue;
            }
            if (!jsonNode.isArray()) {
                return new NodeAndFormat(NullNode.getInstance(), format);
            }
View Full Code Here

    private NodeAndFormat getNodeAndFormat(final String path) {
        JsonNode jsonNode = this.jsonNode;
        final List<String> keys = PathNode.split(path);
        String format = null;
        for (final String key : keys) {
            final PathNode pathNode = PathNode.parse(key);
            if (!pathNode.getKey().isEmpty()) {
                // grab format (if present) before moving down the path
                format = getFormatValueIfAnyFrom(jsonNode);
                jsonNode = jsonNode.path(pathNode.getKey());
            } else {
                // pathNode is criteria only; don't change jsonNode
            }
            if (jsonNode.isNull()) {
                return new NodeAndFormat(jsonNode, format);
            }
            if (!pathNode.hasCriteria()) {
                continue;
            }
            if (!jsonNode.isArray()) {
                return new NodeAndFormat(NullNode.getInstance(), format);
            }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.restfulobjects.applib.util.PathNode

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.