KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > stefanochizzolini > clown > tokens > FileFormatException


1 /*
2   Copyright 2006 Stefano Chizzolini. http://clown.stefanochizzolini.it
3
4   Contributors:
5     * Stefano Chizzolini (original code developer, info@stefanochizzolini.it):
6       contributed code is Copyright 2006 by Stefano Chizzolini.
7
8   This file should be part of the source code distribution of "PDF Clown library"
9   (the Program): see the accompanying README files for more info.
10
11   This Program is free software; you can redistribute it and/or modify it under
12   the terms of the GNU General Public License as published by the Free Software
13   Foundation; either version 2 of the License, or (at your option) any later version.
14
15   This Program is distributed in the hope that it will be useful, but WITHOUT ANY
16   WARRANTY, either expressed or implied; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
18
19   You should have received a copy of the GNU General Public License along with this
20   Program (see README files); if not, go to the GNU website (http://www.gnu.org/).
21
22   Redistribution and use, with or without modification, are permitted provided that such
23   redistributions retain the above copyright notice, license and disclaimer, along with
24   this list of conditions.
25 */

26
27 package it.stefanochizzolini.clown.tokens;
28
29 /**
30   Exception thrown in case of bad file format detection.
31 */

32 public class FileFormatException
33   extends Exception JavaDoc
34 {
35   // <class>
36
// <dynamic>
37
// <fields>
38
private long position;
39   // </fields>
40

41   // <constructors>
42
public FileFormatException(
43     String JavaDoc message,
44     long position
45     )
46   {
47     super(message);
48
49     this.position = position;
50   }
51
52   public FileFormatException(
53     String JavaDoc message,
54     Throwable JavaDoc cause,
55     long position
56     )
57   {
58     super(message,cause);
59
60     this.position = position;
61   }
62   // </constructors>
63

64   // <interface>
65
// <public>
66
/**
67     Gets the file pointer position before which the exception has occurred.
68   */

69   public long getPosition(
70     )
71   {return position;}
72   // </public>
73
// </interface>
74
// </dynamic>
75
// </class>
76
}
Popular Tags