1 15 16 package javassist.compiler; 17 18 import javassist.CannotCompileException; 19 import javassist.NotFoundException; 20 21 public class CompileError extends Exception { 22 private Lex lex; 23 private String reason; 24 25 public CompileError(String s, Lex l) { 26 reason = s; 27 lex = l; 28 } 29 30 public CompileError(String s) { 31 reason = s; 32 lex = null; 33 } 34 35 public CompileError(CannotCompileException e) { 36 this(e.getReason()); 37 } 38 39 public CompileError(NotFoundException e) { 40 this("cannot find " + e.getMessage()); 41 } 42 43 public String getMessage() { 44 return reason; 45 } 46 47 public String toString() { 48 return "compile error: " + reason; 49 } 50 } 51 | Popular Tags |