1 46 package org.codehaus.groovy.control; 47 48 import java.io.PrintWriter ; 49 import java.io.StringWriter ; 50 51 54 public class MultipleCompilationErrorsException extends 55 CompilationFailedException { 56 57 protected ErrorCollector collector; 58 59 public MultipleCompilationErrorsException(ErrorCollector ec) { 60 super(0, null); 61 collector = ec; 62 } 63 64 public ErrorCollector getErrorCollector() { 65 return collector; 66 } 67 68 public String toString() { 69 70 StringWriter data = new StringWriter (); 71 PrintWriter writer = new PrintWriter (data); 72 Janitor janitor = new Janitor(); 73 74 try { 75 collector.write(writer, janitor); 76 } 77 finally { 78 janitor.cleanup(); 79 } 80 81 return data.toString(); 82 } 83 } 84 | Popular Tags |