view src/kryshen/tema/TemplateException.java @ 2:6c41a0b43e58

Tema 0.3 (imported from CVS).
author Mikhail Kryshen <mikhail@kryshen.net>
date Tue, 19 Feb 2008 20:32:17 +0300
parents 548a93c24e55
children e9d13c7ffeb1
line source
1 /*
2 * Copyright 2006-2008 Mikhail Kryshen
3 *
4 * This file is part of Tema.
5 *
6 * Tema is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * Tema is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the
17 * GNU Lesser General Public License along with Tema.
18 * If not, see <http://www.gnu.org/licenses/>.
19 *
20 * $Id: TemplateException.java,v 1.12 2008/02/16 17:56:34 mikhail Exp $
21 */
23 package kryshen.tema;
25 import kryshen.tema.io.TemplateReader;
27 /**
28 * Signals that template parsing fails.
29 *
30 * @author Mikhail Kryshen
31 */
32 public class TemplateException extends Exception {
33 //private String source;
34 //private int line;
36 // public TemplateException(String message) {
37 // super(message);
38 // }
40 // public TemplateException(String message, Throwable cause) {
41 // super(message, cause);
42 // }
44 public TemplateException(String message, Throwable cause,
45 TemplateReader tr) {
46 this(message, cause, tr.getSource(), tr.getLineNumber() + 1);
47 }
49 public TemplateException(String message, TemplateReader tr) {
50 this(message, tr.getSource(), tr.getLineNumber() + 1);
51 }
53 public TemplateException(String message, Throwable cause,
54 String source, int line) {
55 super(source + ":" + line + ": " + message, cause);
56 //this.source = source;
57 //this.line = line;
58 }
60 public TemplateException(String message, String source, int line) {
61 super(source + ":" + line + ": " + message);
62 //this.source = source;
63 //this.line = line;
64 }
65 }