Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12329/modules/ejb/src/xdoclet/modules/ejb/entity

Modified Files:
        ValueObjectTagsHandler.java 
Log Message:
removed the type attribute for ejb.value-object (using the method's return 
type) (XDT-670)

Index: ValueObjectTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/ValueObjectTagsHandler.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** ValueObjectTagsHandler.java 8 Feb 2004 00:17:34 -0000       1.21
--- ValueObjectTagsHandler.java 3 Apr 2005 10:46:57 -0000       1.22
***************
*** 535,538 ****
--- 535,577 ----
      }
  
+     /**
+      * Returns the collection type for the current field.
+      *
+      * @return                   the type
+      * @throws XDocletException  if an error occures
+      * @doc.tag                  type="content"
+      */
+     public String collectionType() throws XDocletException
+     {
+         return 
getCurrentMethod().getReturnType().getType().getQualifiedName();
+     }
+ 
+     /**
+      * Executes the body only if the current field is a collection.
+      *
+      * @param template              the template
+      * @exception XDocletException  if an error occures
+      * @doc.tag                     type="block"
+      */
+     public void ifIsCollection(String template) throws XDocletException
+     {
+         if (isCollection()) {
+             generate(template);
+         }
+     }
+ 
+     /**
+      * Executes the body only if the current field is not a collection.
+      *
+      * @param template              the template
+      * @exception XDocletException  if an error occures
+      * @doc.tag                     type="block"
+      */
+     public void ifIsNotCollection(String template) throws XDocletException
+     {
+         if (!isCollection()) {
+             generate(template);
+         }
+     }
  
      /**
***************
*** 691,694 ****
--- 730,745 ----
      }
  
+     /**
+      * Returns whether the current field is a collection
+      *
+      * @return   <code>true</code> it the current field is a collection
+      */
+     private boolean isCollection()
+     {
+         String currentReturnType = 
getCurrentMethod().getReturnType().getType().getQualifiedName();
+ 
+         return "java.util.Collection".equals(currentReturnType) || 
"java.util.Set".equals(currentReturnType);
+     }
+ 
      private boolean isAbstractValueObject(String valueObjectName, XTag tag)
      {



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to