public Writer writeTo(Writer writer){
  Binding binding;
  if (map == null)   binding=new Binding();
 else   binding=new Binding(map);
  Script scriptObject=InvokerHelper.createScript(script.getClass(),binding);
  PrintWriter pw=new PrintWriter(writer);
  scriptObject.setProperty("out",pw);
  scriptObject.run();
  pw.flush();
  return writer;
}

public Writer writeTo ( Writer writer ) { Binding binding ; if ( map == null ) binding = new Binding ( ) ; else binding = new Binding ( map ) ; Script scriptObject = InvokerHelper . createScript ( script . getClass ( ) , binding ) ; PrintWriter pw = new PrintWriter ( writer ) ; scriptObject . setProperty ( "out" , pw ) ; scriptObject . run ( ) ; pw . flush ( ) ; return writer ; }
write the template document with the set binding applied to the writer .
