geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r159466 - geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/TypeDescBuilder.java
Date Wed, 30 Mar 2005 07:01:18 GMT
Author: djencks
Date: Tue Mar 29 23:01:17 2005
New Revision: 159466

URL: http://svn.apache.org/viewcvs?view=rev&rev=159466
Log:
Possible meaning of nillable

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/TypeDescBuilder.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/TypeDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/TypeDescBuilder.java?view=diff&r1=159465&r2=159466
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/TypeDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/TypeDescBuilder.java
Tue Mar 29 23:01:17 2005
@@ -78,17 +78,16 @@
                 ElementDesc elementDesc = new ElementDesc();
                 elementDesc.setFieldName(fieldName);
                 Class javaType = (Class) properties.get(fieldName);
-                if (javaType != null) {
-                    elementDesc.setJavaType(javaType);
-                } else {
+                if (javaType == null) {
                     //see if it is a public field
                     try {
                         Field field = javaClass.getField(fieldName);
-                        elementDesc.setJavaType(field.getType());
+                        javaType = field.getType();
                     } catch (NoSuchFieldException e) {
                         throw new DeploymentException("field name " + fieldName + " not found
in " + properties);
                     }
                 }
+                elementDesc.setJavaType(javaType);
                 //TODO correct namespace???
                 String namespace = "";
                 QName xmlName = new QName(namespace, variableMapping.getXmlElementName().getStringValue().trim());
@@ -96,10 +95,13 @@
                 QName xmlType = schemaType.getName();
                 elementDesc.setXmlType(xmlType);
                 //TODO figure out how to find these:
+//                if (javaType.isArray()) {
 //                    elementDesc.setArrayType(null);
 //                    elementDesc.setMinOccurs(0);
 //                    elementDesc.setMaxOccurs(0);
-//                    elementDesc.setNillable(false);
+//                }
+                //TODO I have no evidence this is what nillable is supposed to mean, but
it's more plausible than constant true or false.
+                elementDesc.setNillable(!javaType.isPrimitive());
                 fields[i] = elementDesc;
             }
         }



Mime
View raw message