1 5 package xdoclet.modules.apache.bsf; 6 7 import java.util.Properties ; 8 9 import org.apache.commons.logging.Log; 10 import xdoclet.XDocletException; 11 import xdoclet.modules.apache.ScriptEngineTagHandler; 12 13 import xdoclet.template.TemplateException; 14 import xdoclet.util.LogUtil; 15 16 23 public class BsfEngineTagHandler extends ScriptEngineTagHandler 24 { 25 private BsfSubTemplateEngine bsfEngine; 26 27 35 public String getVariable(Properties attributes) throws XDocletException 36 { 37 return getSubTemplateVariable(getBsfEngine(), attributes); 38 } 39 40 50 public void generator(String template, Properties attributes) throws TemplateException 51 { 52 Log log = LogUtil.getLog(BsfEngineTagHandler.class, "generator"); 53 54 log.debug("generator() called."); 55 generate(getBsfEngine(), template, attributes); 56 } 57 58 64 public void clearVariables() throws XDocletException 65 { 66 getBsfEngine().clearVariables(); 67 } 68 69 private BsfSubTemplateEngine getBsfEngine() 70 { 71 if (bsfEngine == null) { 72 bsfEngine = new BsfSubTemplateEngine(); 73 } 74 return bsfEngine; 75 } 76 } 77 78 | Popular Tags |