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

net.thisptr.jackson.jq.exception.JsonQueryBreakException Maven / Gradle / Ivy

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

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.IntNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

public class JsonQueryBreakException extends JsonQueryException {
	private static final long serialVersionUID = -6066878919494380889L;
	private static final ObjectMapper MAPPER = new ObjectMapper();

	private final String name;

	public JsonQueryBreakException(final String name) {
		super("break");
		this.name = name;
	}

	@Override
	public JsonNode getMessageAsJsonNode() {
		final ObjectNode object = MAPPER.createObjectNode();
		object.set("__jq", IntNode.valueOf(0));
		return object;
	}

	public String name() {
		return name;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy