commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1069068 - in /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3: BeanUtilsConverterFacade.java CallMethodRule.java DigesterImpl.java RulesBinderImpl.java
Date Wed, 09 Feb 2011 20:19:24 GMT
Author: simonetripodi
Date: Wed Feb  9 20:19:24 2011
New Revision: 1069068

URL: http://svn.apache.org/viewvc?rev=1069068&view=rev
Log:
back to default commons-beanutils implementation of converters, TypeConverter is still a TODO

Removed:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/BeanUtilsConverterFacade.java
Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/DigesterImpl.java
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java?rev=1069068&r1=1069067&r2=1069068&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/CallMethodRule.java
Wed Feb  9 20:19:24 2011
@@ -19,6 +19,7 @@ package org.apache.commons.digester3;
 
 import java.util.Formatter;
 
+import org.apache.commons.beanutils.ConvertUtils;
 import org.apache.commons.beanutils.MethodUtils;
 import org.xml.sax.Attributes;
 
@@ -229,12 +230,6 @@ public class CallMethodRule extends Rule
             }
 
             parameters = new Object[]{ this.bodyText };
-            /* TODO this situation has to be managed by the builder
-            if (this.paramTypes.length == 0) {
-                this.paramTypes = new Class[1];
-                this.paramTypes[0] = String.class;
-            } */
-
         } else {
             // When paramCount is zero and paramTypes.length is zero it
             // means that we truly are calling a method with no parameters.
@@ -251,7 +246,7 @@ public class CallMethodRule extends Rule
             if (parameters[i] == null
                     || (parameters[i] instanceof String && !String.class.isAssignableFrom(this.paramTypes[i])))
{
 
-                paramValues[i] = this.getDigester().lookupConverter(this.paramTypes[i]).convert((String)
parameters[i]);
+                paramValues[i] = ConvertUtils.convert((String) parameters[i], paramTypes[i]);
             } else {
                 paramValues[i] = parameters[i];
             }

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/DigesterImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/DigesterImpl.java?rev=1069068&r1=1069067&r2=1069068&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/DigesterImpl.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/DigesterImpl.java
Wed Feb  9 20:19:24 2011
@@ -1233,29 +1233,8 @@ final class DigesterImpl implements Dige
      * {@inheritDoc}
      */
     public <T> TypeConverter<T> lookupConverter(final Class<T> type) {
-        // TODO temporary implementation, will be changed for final version
-
-        final Converter converter = ConvertUtils.lookup(type);
-
-        if (converter == null) {
-            return null; // use check delegated to users
-        }
-
-        if (converter instanceof BeanUtilsConverterFacade) {
-            return (TypeConverter<T>) ((BeanUtilsConverterFacade) converter).getWrappedConverter();
-        }
-
-        return new TypeConverter<T>() {
-
-            public T convert(String value) {
-                Object result = converter.convert(type, value);
-                if (result == null) {
-                    return null;
-                }
-                return type.cast(result);
-            }
-
-        };
+        // TODO empty implementation, will be changed for final version
+        return null;
     }
 
 }

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java?rev=1069068&r1=1069067&r2=1069068&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Wed Feb  9 20:19:24 2011
@@ -23,7 +23,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.beanutils.ConvertUtils;
 import org.apache.commons.digester3.rulesbinder.BackToLinkedRuleBuilder;
 import org.apache.commons.digester3.rulesbinder.BeanPropertySetterBuilder;
 import org.apache.commons.digester3.rulesbinder.CallMethodBuilder;
@@ -873,7 +872,7 @@ final class RulesBinderImpl implements R
                                     type.getName())));
                 }
 
-                ConvertUtils.register(new BeanUtilsConverterFacade(typeConverter), type);
+                // TODO register the type converter!!!
             }
 
         };



Mime
View raw message