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

de.derivo.sparqldlapi.exceptions.QueryParserException Maven / Gradle / Ivy

The newest version!
// Copyright (c) 2011. This source code is available under the terms of the GNU Lesser General Public License (LGPL)
// Author: Mario Volke 
// derivo GmbH, James-Franck-Ring, 89081 Ulm 

package de.derivo.sparqldlapi.exceptions;

import de.derivo.sparqldlapi.QueryToken;

public class QueryParserException extends Exception 
{
	private static final long serialVersionUID = 1L;

	QueryToken token;
	
	public QueryParserException(String message)
	{
		super(message);
		token = null;
	}
	
	public QueryParserException(String message, QueryToken token)
	{
		super(message);
		this.token = token;
	}
	
	public String toString()
	{
		String s = this.getMessage();
		if(token != null) {
			s += " (near \"" + token.getToken() + "\", pos: " + token.getPos() + ", col: " + token.getCol() + ", row: " + token.getRow() + ")";
		}
		return s;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy