1 5 package xdoclet.ant; 6 7 import java.util.Hashtable ; 8 import java.util.Properties ; 9 10 import xdoclet.XDocletException; 11 import xdoclet.template.TemplateTagHandler; 12 13 21 public class AntPropertyTagsHandler extends TemplateTagHandler 22 { 23 private Hashtable antProperties; 24 25 30 public AntPropertyTagsHandler(Hashtable antProperties) 31 { 32 this.antProperties = antProperties; 33 } 34 35 36 46 public String property(Properties attributes) throws XDocletException 47 { 48 String propertyName = attributes.getProperty("name"); 49 String propertyValue = (String ) antProperties.get(propertyName); 50 51 if (propertyValue == null) { 52 throw new XDocletException("The referenced property " + propertyName + " is not defined."); 53 } 54 return propertyValue; 55 } 56 } 57 | Popular Tags |