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

com.silentgo.json.report.JSONReport Maven / Gradle / Ivy

There is a newer version: 0.0.9
Show newest version
package com.silentgo.json.report;

import com.silentgo.json.exception.ParseException;
import com.silentgo.json.parser.Reader;

/**
 * Project : SilentGo
 * Package : com.silentgo.json
 *
 * @author teddyzhu
 *         

* Created by teddyzhu on 2017/1/4. */ public class JSONReport implements Reporter { @Override public void report(Reader reader, String msg) { int pos = reader.pos - 10; throw new ParseException("Json parse error : " + msg + " around \n" + reader.peekRange(pos > 0 ? pos : 0, (reader.pos + 5) < reader.end ? (reader.pos + 5) : reader.end) + " \ncol :" + reader.pos); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy