01: package com.etymon.pj.exception;
02:
03: /**
04: An exception that gets thrown when the parser encounters invalid
05: PDF data.
06: @author Nassib Nassar
07: */
08: public class PdfFormatException extends PjException {
09:
10: /**
11: Creates a PdfFormatException with a detailed message.
12: @param s the detailed message.
13: */
14: public PdfFormatException(String s) {
15: super (s);
16: }
17:
18: /**
19: Creates a PdfFormatException with a detailed message and
20: offset. A detailed message is a String that describes this
21: particular exception.
22: @param s the detailed message.
23: @param errorOffset the position where the error is found
24: while parsing.
25: */
26: public PdfFormatException(String s, int errorOffset) {
27: super (s);
28: _errorOffset = errorOffset;
29: }
30:
31: /**
32: Returns the position where the error was found.
33: @return the position where the error was found or -1 if no
34: position information is available.
35: */
36: public int getErrorOffset() {
37: return _errorOffset;
38: }
39:
40: private int _errorOffset = -1;
41:
42: }
|