User: dimc
Date: 02/03/12 01:30:32
Modified: core/src/xdoclet/ejb/tags/vendor JBossTagsHandler.java
Log:
Added check for dependant-value-classes generation - only insert
dvc tag if the application has some DVCs.
Revision Changes Path
1.3 +38 -3 xdoclet/core/src/xdoclet/ejb/tags/vendor/JBossTagsHandler.java
Index: JBossTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/ejb/tags/vendor/JBossTagsHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- JBossTagsHandler.java 26 Oct 2001 11:03:50 -0000 1.2
+++ JBossTagsHandler.java 12 Mar 2002 09:30:31 -0000 1.3
@@ -3,24 +3,31 @@
import org.apache.log4j.Category;
import xdoclet.XDocletException;
import xdoclet.util.Log;
+import xdoclet.util.DocletUtil;
import xdoclet.tags.ClassTagsHandler;
import java.util.Properties;
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.MethodDoc;
+import com.sun.javadoc.Tag;
+
/**
* @author Dmitri Colebatch ([EMAIL PROTECTED])
* @created October 18, 2001
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class JBossTagsHandler extends ClassTagsHandler
{
public String jBossResourceClassName() throws XDocletException
{
Category cat = Log.getCategory( JBossTagsHandler.class,
"jBossResourceClassName" );
+
if( cat.isDebugEnabled() )
{
cat.debug( "Searching @jboss:resource-manager res-man-class
for Class " + getCurrentClass().name() );
}
+
Properties prop = new Properties();
prop.setProperty( "tagName", "jboss:resource-manager" );
@@ -29,4 +36,32 @@
return classTagValue( prop );
}
+
+ /**
+ * Evaluates the body if at least one of the classes has an jboss:dvc tag,
+ * otherwise not.
+ *
+ * @param template The body of the block tag
+ * @exception XDocletException Description of Exception
+ */
+ public void ifHasDVC( String template ) throws XDocletException
+ {
+ boolean hasDVC = false;
+ ClassDoc[] classes = getContext().getRoot().classes();
+
+ for( int i = 0; i < classes.length; i++ )
+ {
+ Tag[] dvc = DocletUtil.getTagsByName( classes[i], "jboss:dvc"
);
+
+ if( dvc != null && dvc.length > 0 )
+ {
+ hasDVC = true;
+ break;
+ }
+ }
+
+ if( hasDVC )
+ generate( template );
+ }
+
}
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel