public static void print ( Object self , Object value ) { // we won't get here if we are a PrintWriter if ( self instanceof Writer ) { try { ( ( Writer ) self ) . write ( InvokerHelper . toString ( value ) ) ; } catch ( IOException e ) { // TODO: Should we have some unified function like PrintWriter.checkError()? } } else { System . out . print ( InvokerHelper . toString ( value ) ) ; } }
Print a value formatted Groovy style to self if it is a Writer otherwise to the standard output stream .