All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.groupbyinc.common.jackson.jq.internal.IsolatedScopeQuery Maven / Gradle / Ivy

There is a newer version: 198
Show newest version
package net.thisptr.jackson.jq.internal;

import java.util.List;

import net.thisptr.jackson.jq.JsonQuery;
import net.thisptr.jackson.jq.Scope;
import net.thisptr.jackson.jq.exception.JsonQueryException;

import com.fasterxml.jackson.databind.JsonNode;

public class IsolatedScopeQuery extends JsonQuery {
	private JsonQuery q;

	public IsolatedScopeQuery(final JsonQuery q) {
		this.q = q;
	}

	@Override
	public List apply(Scope scope, JsonNode in) throws JsonQueryException {
		final Scope isolatedScope = Scope.newChildScope(scope);
		return q.apply(isolatedScope, in);
	}

	@Override
	public String toString() {
		return q.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy