1 5 package xdoclet.modules.doc; 6 7 import java.io.File ; 8 9 import java.util.List ; 10 import xdoclet.ConfigParameter; 11 12 import xdoclet.XDocletException; 13 import xdoclet.XDocletTagSupport; 14 15 24 public class ModuleTagsHandler extends XDocletTagSupport 25 { 26 private String currentModule; 27 28 private static boolean isModule(File file) 29 { 30 File module_build_xml = new File (file, "build.xml"); 31 32 return (!file.getName().equalsIgnoreCase("build")) && (!file.getName().equalsIgnoreCase("cvs")) && module_build_xml.exists(); 33 } 34 35 public String moduleName() 36 { 37 return currentModule; 38 } 39 40 47 public void forAllModules(String template) throws XDocletException 48 { 49 List cps = getDocletContext().getActiveSubTask().getConfigParams(); 50 ConfigParameter cp = (ConfigParameter) cps.get(0); 51 File moduleParentDir = new File (cp.getValue()); 52 File [] moduleDirs = moduleParentDir.listFiles(); 53 54 for (int i = 0; i < moduleDirs.length; i++) { 55 if (isModule(moduleDirs[i])) { 56 currentModule = moduleDirs[i].getName(); 57 generate(template); 58 } 59 } 60 } 61 } 62 | Popular Tags |