Examples of toIterable()


Examples of com.jayway.jsonpath.spi.JsonProvider.toIterable()

    public Object filter(Object obj, Configuration configuration) {
        JsonProvider jsonProvider = configuration.getProvider();
        Object result = jsonProvider.createArray();

        if (jsonProvider.isArray(obj)) {
            for (Object current : jsonProvider.toIterable(obj)) {
                for (Object value : jsonProvider.toIterable(current)) {
                    jsonProvider.setProperty(result, jsonProvider.length(result), value);
                }
            }
        } else {
View Full Code Here

Examples of com.jayway.jsonpath.spi.JsonProvider.toIterable()

        JsonProvider jsonProvider = configuration.getProvider();
        Object result = jsonProvider.createArray();

        if (jsonProvider.isArray(obj)) {
            for (Object current : jsonProvider.toIterable(obj)) {
                for (Object value : jsonProvider.toIterable(current)) {
                    jsonProvider.setProperty(result, jsonProvider.length(result), value);
                }
            }
        } else {
            for (Object value : jsonProvider.toIterable(obj)) {
View Full Code Here

Examples of com.jayway.jsonpath.spi.JsonProvider.toIterable()

                for (Object value : jsonProvider.toIterable(current)) {
                    jsonProvider.setProperty(result, jsonProvider.length(result), value);
                }
            }
        } else {
            for (Object value : jsonProvider.toIterable(obj)) {
                jsonProvider.setProperty(result, jsonProvider.length(result), value);
            }
        }
        return result;
    }
View Full Code Here

Examples of com.jayway.jsonpath.spi.JsonProvider.toIterable()

    @Override
    public Object filter(Object obj, Configuration configuration) {
        JsonProvider jsonProvider = configuration.getProvider();
        Iterable<Object> src = null;
        try {
            src = jsonProvider.toIterable(obj);
        } catch (ClassCastException e){
            throw new PathNotFoundException("The path fragment '" + this.condition + "' can not be applied to a JSON object only a JSON array.", e);
        }
        Object result = jsonProvider.createArray();
        for (Object item : src) {
View Full Code Here

Examples of com.jayway.jsonpath.spi.JsonProvider.toIterable()

        if (jsonProvider.isArray(obj)) {
            if (!inArrayContext) {
                throw new PathNotFoundException("Path '" + condition + "' is being applied to an array. Arrays can not have attributes.");
            } else {
                Object result = jsonProvider.createArray();
                for (Object current : jsonProvider.toIterable(obj)) {
                    if (jsonProvider.isMap(current)) {
                       
                        Collection<String> keys = jsonProvider.getPropertyKeys(current);

                        if(split.length == 1){
View Full Code Here

Examples of com.jayway.jsonpath.spi.JsonProvider.toIterable()

                                Object o = jsonProvider.getProperty(current, condition);

                                boolean isArr = jsonProvider.isArray(o);
                                boolean isEnd = pathToken.isEndToken();
                                if (isArr && !isEnd) {
                                    for(Object item : jsonProvider.toIterable(o)){
                                        jsonProvider.setProperty(result, jsonProvider.length(result), item);
                                    }
                                } else {
                                    jsonProvider.setProperty(result, jsonProvider.length(result), jsonProvider.getProperty(current, condition));
                                }
View Full Code Here

Examples of com.jayway.jsonpath.spi.JsonProvider.toIterable()

    @Override
    public Object filter(Object obj, Configuration configuration) {
        JsonProvider jsonProvider = configuration.getProvider();

        //[?(@.isbn)]
        Iterable<Object> src = jsonProvider.toIterable(obj);
        Object result = jsonProvider.createArray();

        for (Object item : src) {
            if(jsonProvider.isMap(item)){
                try{
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.