1 18 package org.apache.batik.parser; 19 20 32 public class ParseException extends RuntimeException { 33 36 protected Exception exception; 37 38 41 protected int lineNumber; 42 43 46 protected int columnNumber; 47 48 54 public ParseException (String message, int line, int column) { 55 super(message); 56 exception = null; 57 lineNumber = line; 58 columnNumber = column; 59 } 60 61 69 public ParseException (Exception e) { 70 exception = e; 71 lineNumber = -1; 72 columnNumber = -1; 73 } 74 75 83 public ParseException (String message, Exception e) { 84 super(message); 85 this.exception = e; 86 } 87 88 96 public String getMessage () { 97 String message = super.getMessage(); 98 99 if (message == null && exception != null) { 100 return exception.getMessage(); 101 } else { 102 return message; 103 } 104 } 105 106 110 public Exception getException () { 111 return exception; 112 } 113 114 117 public int getLineNumber() { 118 return lineNumber; 119 } 120 121 124 public int getColumnNumber() { 125 return columnNumber; 126 } 127 } 128 | Popular Tags |