1 package org.sapia.util.text; 2 3 4 /** 5 * Renders parsed data from a <code>TemplateFactoryIF</code>. 6 * 7 * @author JC Desrochers. 8 * 9 * <dl> 10 * <dt><b>Copyright:</b><dd>Copyright © 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt> 11 * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the 12 * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt> 13 * </dl> 14 */ 15 public interface TemplateElementIF { 16 /** 17 * Renders this template element using the template context passed in and 18 * returns the result in a new string. 19 * 20 * @param aContext The template context to use in the rendering process. 21 * @return The result of the rendering operation as a new string. 22 * @exception TemplateException If an error occurs rendering this template element. 23 */ 24 public String render(TemplateContextIF aContext) throws TemplateException; 25 26 /** 27 * Renders this template element using the template context passed in and 28 * appending the result in the string buffer passed in. 29 * 30 * @param aContext The template context to use in the rendering process. 31 * @exception TemplateException If an error occurs rendering this template element. 32 */ 33 public void render(TemplateContextIF aContext, StringBuffer aBuffer) 34 throws TemplateException; 35 } 36