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

Modified Files:
        PersistentTagsHandler.java CmpTagsHandler.java 
Log Message:
Fix CMP field initial upper/lower case problem (XDT-528/XDT-600).
Thanks to Matthias Germann for patches.




Index: PersistentTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/PersistentTagsHandler.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** PersistentTagsHandler.java  15 Jan 2005 01:05:46 -0000      1.20
--- PersistentTagsHandler.java  15 Jan 2005 01:11:39 -0000      1.21
***************
*** 171,175 ****
                          foundFields.put(method.getName(), method);
  
!                         name = MethodTagsHandler.getPropertyNameFor(method);
  
                          methodType = 
MethodTagsHandler.getMethodTypeFor(method);
--- 171,175 ----
                          foundFields.put(method.getName(), method);
  
!                         name = CmpTagsHandler.getFieldNameFor(method);
  
                          methodType = 
MethodTagsHandler.getMethodTypeFor(method);

Index: CmpTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/CmpTagsHandler.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** CmpTagsHandler.java 3 Sep 2004 18:57:59 -0000       1.15
--- CmpTagsHandler.java 15 Jan 2005 01:11:39 -0000      1.16
***************
*** 149,152 ****
--- 149,171 ----
  
      /**
+      * Returns the cmp-version 2.x compatible cmp / cmr field name for the 
passed method.
+      *
+      * @param method                the method
+      * @return                      the field name
+      * @exception XDocletException
+      */
+     public static String getFieldNameFor(XMethod method) throws 
XDocletException
+     {
+         // remove get/set
+         String m = method.getName().substring(3);
+ 
+         // replace first character to lowercase
+         char firstU = m.charAt(0);
+         char firstL = Character.toLowerCase(firstU);
+ 
+         return firstL + m.substring(1);
+     }
+ 
+     /**
       * Gets the EntityCmpClassPattern attribute of the CmpTagsHandler class
       *
***************
*** 361,363 ****
--- 380,394 ----
          }
      }
+ 
+     /**
+      * Returns the cmp-version 2.x compatible cmp / cmr field name for the 
current method.
+      *
+      * @return                      the field name
+      * @exception XDocletException
+      * @doc.tag                     type="content"
+      */
+     public String fieldName() throws XDocletException
+     {
+         return getFieldNameFor(getCurrentMethod());
+     }
  }



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to