Mercurial Hosting > luan
comparison lucene/src/luan/modules/lucene/queryparser/ParseException.java @ 730:01e68da6983b
add sane-lucene-queryparser source to luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 10 Jun 2016 15:41:15 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
729:4ce68aad92b7 | 730:01e68da6983b |
---|---|
1 package luan.modules.lucene.queryparser; | |
2 | |
3 | |
4 public final class ParseException extends Exception { | |
5 public final String text; | |
6 public final int errorIndex; | |
7 public final int highIndex; | |
8 | |
9 public ParseException(SaneQueryParser qp) { | |
10 this(qp,"Invalid input"); | |
11 } | |
12 | |
13 public ParseException(SaneQueryParser qp,String msg) { | |
14 super(msg+" at position "+(qp.parser.errorIndex()+1)); | |
15 Parser parser = qp.parser; | |
16 this.text = parser.text; | |
17 this.errorIndex = parser.errorIndex(); | |
18 this.highIndex = parser.highIndex(); | |
19 } | |
20 | |
21 public ParseException(SaneQueryParser qp,Exception cause) { | |
22 this(qp,cause.getMessage(),cause); | |
23 } | |
24 | |
25 public ParseException(SaneQueryParser qp,String msg,Exception cause) { | |
26 super(msg+" at position "+(qp.parser.errorIndex()+1),cause); | |
27 Parser parser = qp.parser; | |
28 this.text = parser.text; | |
29 this.errorIndex = parser.errorIndex(); | |
30 this.highIndex = parser.highIndex(); | |
31 } | |
32 | |
33 } |