axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r399135 - /webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java
Date Wed, 03 May 2006 04:45:25 GMT
Author: gawor
Date: Tue May  2 21:45:23 2006
New Revision: 399135

URL: http://svn.apache.org/viewcvs?rev=399135&view=rev
Log:
allow to disable null check in bean serializer

Modified:
    webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java

Modified: webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java?rev=399135&r1=399134&r2=399135&view=diff
==============================================================================
--- webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java (original)
+++ webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java Tue May
 2 21:45:23 2006
@@ -18,6 +18,7 @@
 
 import org.apache.axis.AxisFault;
 import org.apache.axis.Constants;
+import org.apache.axis.AxisProperties;
 import org.apache.axis.components.logger.LogFactory;
 import org.apache.axis.description.FieldDesc;
 import org.apache.axis.description.TypeDesc;
@@ -62,11 +63,22 @@
     private static final Object[] ZERO_ARGS =
         new Object [] { "0" };
 
+    public static final String PROP_ERROR_ON_NULL_VALUE = 
+        "BeanSerializer.errorOnNullWithNonNillableElement";
+
     QName xmlType;
     Class javaType;
 
+    protected static boolean errorOnNullWithNonNillableElement = true;
+
     protected BeanPropertyDescriptor[] propertyDescriptor = null;
     protected TypeDesc typeDesc = null;
+    
+    static {
+        errorOnNullWithNonNillableElement = 
+            JavaUtils.isTrue(
+                AxisProperties.getProperty(PROP_ERROR_ON_NULL_VALUE, "true"));
+    }
 
     // Construct BeanSerializer for the indicated class/qname
     public BeanSerializer(Class javaType, QName xmlType) {
@@ -211,7 +223,7 @@
                                     }
                                 }
 
-                                if (propValue == null) {
+                                if (propValue == null && errorOnNullWithNonNillableElement)
{
                                     throw new IOException(
                                             Messages.getMessage(
                                                     "nullNonNillableElement",



Mime
View raw message