1 package org.codehaus.groovy.control.messages; 2 3 import java.io.PrintWriter ; 4 5 import org.codehaus.groovy.control.Janitor; 6 import org.codehaus.groovy.control.ProcessingUnit; 7 import org.codehaus.groovy.syntax.SyntaxException; 8 9 10 11 18 19 public abstract class Message 20 { 21 22 23 27 28 public abstract void write( PrintWriter writer, ProcessingUnit owner, Janitor janitor ); 29 30 31 34 35 public final void write( PrintWriter writer, ProcessingUnit owner ) 36 { 37 write( writer, owner, null ); 38 } 39 40 41 42 45 46 49 50 public static Message create( String text ) 51 { 52 return new SimpleMessage( text ); 53 } 54 55 56 57 60 61 public static Message create( String text, Object data ) 62 { 63 return new SimpleMessage( text, data ); 64 } 65 66 67 68 71 72 public static Message create( SyntaxException error ) 73 { 74 return new SyntaxErrorMessage( error ); 75 } 76 77 78 79 80 } 81 82 83 84 85 | Popular Tags |