rdonkin     2004/02/17 15:11:00

  Modified:    betwixt/src/java/org/apache/commons/betwixt/io
                        SAXBeanWriter.java
               betwixt/src/java/org/apache/commons/betwixt/io/read
                        ElementMapping.java
               betwixt/src/java/org/apache/commons/betwixt/strategy
                        ConvertUtilsObjectStringConverter.java
  Log:
  Altered default behaviour for object string conversions so that nulls and empty 
strings are no longer passed to convert utils for conversion.
  
  Revision  Changes    Path
  1.13      +5 -5      
jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/SAXBeanWriter.java
  
  Index: SAXBeanWriter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/SAXBeanWriter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SAXBeanWriter.java        9 Oct 2003 20:52:06 -0000       1.12
  +++ SAXBeanWriter.java        17 Feb 2004 23:11:00 -0000      1.13
  @@ -62,9 +62,9 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.xml.sax.Attributes;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.SAXException;
  -import org.xml.sax.Attributes;
   
   // FIX ME
   // At the moment, namespaces are NOT supported!
  
  
  
  1.5       +5 -6      
jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ElementMapping.java
  
  Index: ElementMapping.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ElementMapping.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ElementMapping.java       9 Oct 2003 20:52:06 -0000       1.4
  +++ ElementMapping.java       17 Feb 2004 23:11:00 -0000      1.5
  @@ -60,9 +60,8 @@
    */ 
   package org.apache.commons.betwixt.io.read;
   
  -import org.xml.sax.Attributes;
  -
   import org.apache.commons.betwixt.ElementDescriptor;
  +import org.xml.sax.Attributes;
   
   /**  
     * Describes a mapping between an xml element and a betwixt element.
  
  
  
  1.5       +10 -4     
jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java
  
  Index: ConvertUtilsObjectStringConverter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConvertUtilsObjectStringConverter.java    9 Oct 2003 20:52:06 -0000       1.4
  +++ ConvertUtilsObjectStringConverter.java    17 Feb 2004 23:11:00 -0000      1.5
  @@ -94,6 +94,7 @@
       
       /**
         * Converts an object to a string representation using ConvertUtils.
  +      * This implementation ignores null and empty string values (rather than 
converting them).
         * 
         * @param value the String to be converted, not null
         * @param type the property class to be returned (if possible), not null
  @@ -103,6 +104,11 @@
         * @return an Object converted from the String, not null
         */
       public Object stringToObject(String value, Class type, String flavour, Context 
context) {
  +        if (value == null || "".equals(value))
  +        {
  +            return null;    
  +        }
  +        
           return ConvertUtils.convert( value, type );
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to