Update of 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-castor/src/main/java/org/xdoclet/plugin/castor
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7034/plugin-castor/src/main/java/org/xdoclet/plugin/castor

Modified Files:
        CastorMappingXMLPlugin.java 
Log Message:


Index: CastorMappingXMLPlugin.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-castor/src/main/java/org/xdoclet/plugin/castor/CastorMappingXMLPlugin.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CastorMappingXMLPlugin.java 11 Mar 2006 19:47:40 -0000      1.4
--- CastorMappingXMLPlugin.java 14 Mar 2006 10:42:14 -0000      1.5
***************
*** 411,414 ****
--- 411,434 ----
      }
  
+     public String getFieldCollection(AbstractJavaEntity fieldOrMethod) {
+         String fieldCollection = 
fieldOrMethod.getNamedParameter("castor.field", "collection");
+         
+         if (fieldCollection == null) {
+             Type type = null;
+             String fieldType = 
fieldOrMethod.getNamedParameter("castor.field", "type");
+     
+             if (fieldOrMethod instanceof JavaField) {
+                 type = ((JavaField) fieldOrMethod).getType();
+             } else if (fieldOrMethod instanceof JavaMethod) {
+                 type = ((JavaMethod) fieldOrMethod).getPropertyType();
+             }
+         
+             if ((fieldType == null) && (type != null) && type.isArray()) {
+                 fieldCollection = "array";
+             }
+         }
+         return fieldCollection;
+     }
+     
      /**
       * An utility method to resolve the type for the mapping field. If the 
tag name "castor.field#type" is
***************
*** 443,446 ****
--- 463,469 ----
  
                      int dimensions = type.getDimensions();
+                     // Quick fix: When used at field level, 
+                     // this must be the type for "collections"
+                     dimensions --;
  
                      for (int i = 0; i < dimensions; i++) {



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to