1 5 package xdoclet.loader; 6 7 import java.net.URL ; 8 9 import java.util.ArrayList ; 10 import java.util.List ; 11 12 import org.apache.commons.logging.Log; 13 14 import xdoclet.util.LogUtil; 15 16 23 public class XDocletModule 24 { 25 private ArrayList _tagHandlers = new ArrayList (); 26 private ArrayList _subTasks = new ArrayList (); 27 private URL _xtagsDefinition = null; 28 29 public XDocletModule() 30 { 31 } 32 33 public List getTagHandlerDefinitions() 34 { 35 return _tagHandlers; 36 } 37 38 public List getSubTaskDefinitions() 39 { 40 return _subTasks; 41 } 42 43 public URL getXTagsDefinitionURL() 44 { 45 return _xtagsDefinition; 46 } 47 48 public void addTagHandler(String namespace, String clazz) 49 { 50 Log log = LogUtil.getLog(getClass(), "addTagHandler"); 51 52 try { 53 log.debug("registering tag tandler " + clazz + " to namespace " + namespace + '.'); 54 55 TagHandlerDefinition thd = new TagHandlerDefinition(namespace, clazz); 56 57 _tagHandlers.add(thd); 58 } 59 catch (Throwable t) { 60 log.error("Couldn't register tag handler " + clazz + ':' + t.getMessage()); 61 } 62 } 63 64 public void addSubTask(String name, String implementationClass, String parentTaskClass) 65 { 66 if (!name.equals(name.toLowerCase())) { 67 throw new IllegalStateException ("Subtask names must be lowercase. Please modify the name of the subtask (" + name + ')'); 68 } 69 _subTasks.add(new SubTaskDefinition(name, implementationClass, parentTaskClass)); 70 } 71 72 void setXTagsDefinitionURL(URL xtagsDefinition) 73 { 74 _xtagsDefinition = xtagsDefinition; 75 } 76 } 77 | Popular Tags |