1 5 package xdoclet.modules.apache.velocity; 6 7 import java.util.Properties ; 8 9 import xdoclet.XDocletException; 10 import xdoclet.modules.apache.ScriptEngineTagHandler; 11 import xdoclet.template.TemplateException; 12 13 14 21 public class VelocityEngineTagHandler extends ScriptEngineTagHandler 22 { 23 40 private VelocitySubTemplateEngine velocityEngine; 41 42 43 53 public String getVariable(Properties attributes) throws XDocletException 54 { 55 return getSubTemplateVariable(getVelocityEngine(), attributes); 56 } 57 58 68 public void generator(String template, Properties attributes) throws TemplateException 69 { 70 generate(getVelocityEngine(), template, attributes); 71 } 72 73 79 public void clearVariables() throws XDocletException 80 { 81 getVelocityEngine().clearVariables(); 82 } 83 84 private VelocitySubTemplateEngine getVelocityEngine() 85 { 86 if (velocityEngine == null) { 87 velocityEngine = new VelocitySubTemplateEngine(); 88 } 89 return velocityEngine; 90 } 91 } 92 93 | Popular Tags |