camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r954908 - /camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
Date Tue, 15 Jun 2010 14:29:41 GMT
Author: jstrachan
Date: Tue Jun 15 14:29:40 2010
New Revision: 954908

URL: http://svn.apache.org/viewvc?rev=954908&view=rev
Log:
added type converter so its easy to set the description on a ProcessorDefinition using reflection
with a String

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java?rev=954908&r1=954907&r2=954908&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java Tue
Jun 15 14:29:40 2010
@@ -22,6 +22,7 @@ import org.apache.camel.Expression;
 import org.apache.camel.Message;
 import org.apache.camel.Predicate;
 import org.apache.camel.Processor;
+import org.apache.camel.model.DescriptionDefinition;
 
 /**
  * Some useful converters for Camel APIs such as to convert a {@link Predicate} or {@link
Expression}
@@ -56,4 +57,11 @@ public class CamelConverter {
             }
         };
     }
+
+    @Converter
+    public DescriptionDefinition toDefinition(String descriptionText) {
+        DescriptionDefinition answer = new DescriptionDefinition();
+        answer.setText(descriptionText);
+        return answer;
+    }
 }



Mime
View raw message