1 5 package xdoclet.modules.jboss.ejb; 6 7 import java.io.File ; 8 import java.util.Collection ; 9 import java.util.Iterator ; 10 import java.util.Properties ; 11 import xjavadoc.*; 12 import xdoclet.XDocletException; 13 import xdoclet.tagshandler.ClassTagsHandler; 14 15 22 public class JBossTagsHandler extends ClassTagsHandler 23 { 24 30 public void ifHasDVC(String template) throws XDocletException 31 { 32 boolean hasDVC = false; 33 Collection classes = getXJavaDoc().getSourceClasses(); 34 35 for (Iterator i = classes.iterator(); i.hasNext(); ) { 36 XClass clazz = (XClass) i.next(); 37 XTag dvc = clazz.getDoc().getTag("jboss:dvc"); 38 39 if (dvc != null) { 40 hasDVC = true; 41 break; 42 } 43 } 44 45 if (!hasDVC) { 47 File mergeFile = new File (getDocletContext().getActiveSubTask().getMergeDir(), "jbosscmp-jdbc-dvc.xml"); 48 49 if (mergeFile.exists()) 50 hasDVC = true; 51 } 52 53 if (hasDVC) { 54 generate(template); 55 } 56 } 57 58 public void ifMethodTagMatchesClassTag(String template, Properties attributes) throws XDocletException 59 { 60 String paramName = attributes.getProperty("paramName"); 61 String classLoadGroup = getCurrentClassTag().getAttributeValue(paramName); 62 String methodLoadGroup = getCurrentMethodTag().getAttributeValue(paramName); 63 64 if (classLoadGroup.equals(methodLoadGroup)) { 65 generate(template); 66 } 67 } 68 69 } 70 | Popular Tags |