Package com.jayway.jsonpath.internal

Examples of com.jayway.jsonpath.internal.EvaluationContext


     * @return the updated jsonObject
     */
    public <T> T set(Object jsonObject, Object newVal, Configuration configuration) {
        notNull(jsonObject, "json can not be null");
        notNull(configuration, "configuration can not be null");
        EvaluationContext evaluationContext = path.evaluate(jsonObject, jsonObject, configuration, true);
        for (PathRef updateOperation : evaluationContext.updateOperations()) {
            updateOperation.set(newVal, configuration);
        }
        return (T)jsonObject;
    }
View Full Code Here


     * @return the updated jsonObject
     */
    public <T> T delete(Object jsonObject, Configuration configuration) {
        notNull(jsonObject, "json can not be null");
        notNull(configuration, "configuration can not be null");
        EvaluationContext evaluationContext = path.evaluate(jsonObject, jsonObject, configuration, true);
        for (PathRef updateOperation : evaluationContext.updateOperations()) {
            updateOperation.delete(configuration);
        }
        return (T)jsonObject;
    }
View Full Code Here

     * @return the updated jsonObject
     */
    public <T> T add(Object jsonObject, Object value, Configuration configuration) {
        notNull(jsonObject, "json can not be null");
        notNull(configuration, "configuration can not be null");
        EvaluationContext evaluationContext = path.evaluate(jsonObject, jsonObject, configuration, true);
        for (PathRef updateOperation : evaluationContext.updateOperations()) {
            updateOperation.add(value, configuration);
        }
        return (T)jsonObject;
    }
View Full Code Here

     */
    public <T> T put(Object jsonObject, String key, Object value, Configuration configuration) {
        notNull(jsonObject, "json can not be null");
        notEmpty(key, "key can not be null or empty");
        notNull(configuration, "configuration can not be null");
        EvaluationContext evaluationContext = path.evaluate(jsonObject, jsonObject, configuration, true);
        for (PathRef updateOperation : evaluationContext.updateOperations()) {
            updateOperation.put(key, value, configuration);
        }
        return (T)jsonObject;
    }
View Full Code Here

TOP

Related Classes of com.jayway.jsonpath.internal.EvaluationContext

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.