activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r529180 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter: ArrayTypeConverter.java DefaultTypeConverter.java ToArrayTypeConverter.java
Date Mon, 16 Apr 2007 09:17:22 GMT
Author: jstrachan
Date: Mon Apr 16 02:17:21 2007
New Revision: 529180

URL: http://svn.apache.org/viewvc?view=rev&rev=529180
Log:
minor refactor and javadoc tidy up

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ArrayTypeConverter.java
      - copied, changed from r529177, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ToArrayTypeConverter.java
Removed:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ToArrayTypeConverter.java
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java

Copied: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ArrayTypeConverter.java
(from r529177, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ToArrayTypeConverter.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ArrayTypeConverter.java?view=diff&rev=529180&p1=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ToArrayTypeConverter.java&r1=529177&p2=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ArrayTypeConverter.java&r2=529180
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ToArrayTypeConverter.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/ArrayTypeConverter.java
Mon Apr 16 02:17:21 2007
@@ -25,12 +25,12 @@
 import java.util.List;
 
 /**
- * A type converter which is used to create derived types of arrays
- * from collections
+ * A type converter which is used to convert to and from array types particularly for derived
types of array
+ * component types and dealing with primitive array types.
  *
  * @version $Revision: $
  */
-public class ToArrayTypeConverter implements TypeConverter {
+public class ArrayTypeConverter implements TypeConverter {
     public <T> T convertTo(Class<T> type, Object value) {
         if (type.isArray()) {
             if (value instanceof Collection) {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java?view=diff&rev=529180&r1=529179&r2=529180
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
Mon Apr 16 02:17:21 2007
@@ -46,7 +46,7 @@
         typeConverterLoaders.add(new AnnotationTypeConverterLoader());
         fallbackConverters.add(new PropertyEditorTypeConverter());
         fallbackConverters.add(new ToStringTypeConverter());
-        fallbackConverters.add(new ToArrayTypeConverter());
+        fallbackConverters.add(new ArrayTypeConverter());
     }
 
     public DefaultTypeConverter(Injector injector) {
@@ -126,15 +126,6 @@
      * Tries to auto-discover any available type converters
      */
     protected TypeConverter findTypeConverter(Class toType, Class fromType, Object value)
{
-
-        // TODO should we filter out any interfaces which are super-interfaces?
-        for (Class type : toType.getInterfaces()) {
-            TypeConverter converter = getTypeConverter(type, fromType);
-            if (converter != null) {
-                return converter;
-            }
-        }
-
         // lets try the super classes of the from type
         if (fromType != null) {
             Class fromSuperClass = fromType.getSuperclass();



Mime
View raw message