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

net.thisptr.jackson.jq.internal.tree.matcher.PatternMatcher Maven / Gradle / Ivy

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

import java.util.List;
import java.util.Stack;

import com.fasterxml.jackson.databind.JsonNode;

import net.thisptr.jackson.jq.Scope;
import net.thisptr.jackson.jq.exception.JsonQueryException;
import net.thisptr.jackson.jq.internal.misc.Functional;
import net.thisptr.jackson.jq.internal.misc.Pair;
import net.thisptr.jackson.jq.path.Path;

public interface PatternMatcher {
	void match(final Scope scope, final JsonNode in, final Functional.Consumer>> out, final Stack> accumulate) throws JsonQueryException;

	public static class MatchWithPath {
		public final String name;
		public final JsonNode value;
		public final Path path;

		public MatchWithPath(final String name, final JsonNode value, final Path path) {
			this.name = name;
			this.value = value;
			this.path = path;
		}
	}

	public interface MatchOutput {
		void emit(List vars) throws JsonQueryException;
	}

	void matchWithPath(Scope scope, JsonNode in, Path path, MatchOutput output, Stack accumulate) throws JsonQueryException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy