1 18 package org.apache.beehive.netui.compiler.typesystem.impl.env; 19 20 import org.apache.beehive.netui.compiler.typesystem.env.Messager; 21 import org.apache.beehive.netui.compiler.typesystem.impl.DelegatingImpl; 22 import org.apache.beehive.netui.compiler.typesystem.util.SourcePosition; 23 24 public class MessagerImpl 25 extends DelegatingImpl 26 implements Messager 27 { 28 protected MessagerImpl( com.sun.mirror.apt.Messager delegate ) 29 { 30 super( delegate ); 31 } 32 33 public static Messager get( com.sun.mirror.apt.Messager delegate ) 34 { 35 return delegate != null ? new MessagerImpl( delegate ) : null; 36 } 37 38 public void printError( String s ) 39 { 40 getDelegate().printError( s ); 41 } 42 43 public void printError( SourcePosition sourcePosition, String s ) 44 { 45 if ( sourcePosition != null ) 46 { 47 assert sourcePosition instanceof SourcePositionImpl : sourcePosition.getClass().getName(); 48 getDelegate().printError( ( ( SourcePositionImpl ) sourcePosition ).getDelegate(), s ); 49 } 50 else 51 { 52 getDelegate().printError( s ); 53 } 54 } 55 56 public void printWarning( String s ) 57 { 58 getDelegate().printWarning( s ); 59 } 60 61 public void printWarning( SourcePosition sourcePosition, String s ) 62 { 63 if ( sourcePosition != null ) 64 { 65 assert sourcePosition instanceof SourcePositionImpl : sourcePosition.getClass().getName(); 66 getDelegate().printWarning( ( ( SourcePositionImpl ) sourcePosition ).getDelegate(), s ); 67 } 68 else 69 { 70 getDelegate().printWarning( s ); 71 } 72 } 73 74 public void printNotice( String s ) 75 { 76 getDelegate().printNotice( s ); 77 } 78 79 public void printNotice( SourcePosition sourcePosition, String s ) 80 { 81 assert sourcePosition != null; 82 assert sourcePosition instanceof SourcePositionImpl : sourcePosition.getClass().getName(); 83 getDelegate().printNotice( ( ( SourcePositionImpl ) sourcePosition ).getDelegate(), s ); 84 } 85 86 protected com.sun.mirror.apt.Messager getDelegate() 87 { 88 return ( com.sun.mirror.apt.Messager ) super.getDelegate(); 89 } 90 } 91 | Popular Tags |