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

com.github.bloodshura.ignitium.cfg.json.JsonParseException Maven / Gradle / Ivy

package com.github.bloodshura.ignitium.cfg.json;

import com.github.bloodshura.ignitium.exception.UncheckedException;

public class JsonParseException extends UncheckedException {
	private final ErrorType errorType;
	private final int position;
	private final Object relatedObject;

	public JsonParseException(ErrorType errorType, int position, Object relatedObject) {
		super(errorType + ": \"" + relatedObject + "\" at position " + position);
		this.errorType = errorType;
		this.position = position;
		this.relatedObject = relatedObject;
	}

	public ErrorType getErrorType() {
		return errorType;
	}

	public int getPosition() {
		return position;
	}

	public Object getRelatedObject() {
		return relatedObject;
	}

	public static enum ErrorType {
		UNEXPECTED_CHAR,
		UNEXPECTED_TOKEN,
		UNEXPECTED_VALUE,
		UNKNOWN_EXCEPTION
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy