1 9 10 package org.jboss.portal.format.template; 11 12 import java.io.StringWriter ; 13 import java.io.Writer ; 14 15 import org.apache.log4j.Logger; 16 17 20 public abstract class Template 21 { 22 23 public final Logger log = Logger.getLogger(getClass()); 24 25 protected final Context local; 26 27 public Template(Context local) 28 { 29 this.local = local; 30 } 31 32 public final String render(Context ctx) 33 { 34 StringWriter writer = new StringWriter (); 35 render(ctx, writer); 36 return writer.toString(); 37 } 38 39 public final Context getLocalContext() 40 { 41 return local; 42 } 43 44 47 public void render(Context ctx, Writer writer) 48 { 49 } 50 51 } 52 | Popular Tags |