You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2017/06/01 07:20:44 UTC

svn commit: r1013264 - in /websites/production/camel/content: cache/main.pageCache type-converter.html

Author: buildbot
Date: Thu Jun  1 07:20:43 2017
New Revision: 1013264

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/type-converter.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/type-converter.html
==============================================================================
--- websites/production/camel/content/type-converter.html (original)
+++ websites/production/camel/content/type-converter.html Thu Jun  1 07:20:43 2017
@@ -108,7 +108,7 @@ Document document = message.getBody(Docu
 // add our own type converter manually that converts from String -> MyOrder using MyOrderTypeConverter
 context.getTypeConverterRegistry().addTypeConverter(MyOrder.class, String.class, new MyOrderTypeConverter());
 ]]></script>
-</div></div><p>And our type converter is implemented as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>And our type converter is implemented as:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 private static class MyOrderTypeConverter extends TypeConverterSupport {
 
@@ -121,7 +121,7 @@ private static class MyOrderTypeConverte
     }
 }
 ]]></script>
-</div></div><p>And then we can convert from String to MyOrder as we are used to with the type converter:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div>And then we can convert from String to MyOrder as we are used to with the type converter:<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 MyOrder order = context.getTypeConverter().convertTo(MyOrder.class, &quot;123&quot;);
 ]]></script>
@@ -189,7 +189,7 @@ public class IOConverter {
         return null;
     }
 ]]></script>
-</div></div><h3 id="TypeConverter-WritingyourownTypeConverters">Writing your own Type Converters</h3><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Use FQN</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>In <strong>Camel 2.8</strong> the TypeConverter file now supports specifying the FQN class name. This is recommended to be used. See below for more details</p></div></div><p>You are welcome to write your own converters. Remember to use the @Converter annotations on the classes and methods you wish to use. Then add the packages to a file called <em>META-INF/services/org/apache/camel/TypeConverter</em> in your jar. Remember to make sure that :-</p><ul><li>static methods are encouraged to reduce caching, but instance methods are fine, particularly if you want to allow optional dependency injection to customize the converter</li><li>conver
 ter methods should be thread safe and reentrant</li></ul><h4 id="TypeConverter-ExamplesofTypeConverterfile">Examples of TypeConverter file</h4><p>The file in the JAR: <code>META-INF/services/org/apache/camel/TypeConverter</code> contains the following line(s)</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="TypeConverter-WritingyourownTypeConverters">Writing your own Type Converters</h3><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Use FQN</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>In Camel 2.8 the TypeConverter file now supports specifying the FQN class name. This is recommended to be used. See below for more details. Using FQN must be used. The older way with just package name is deprecated and should not be used, and it may also not work in some application servers due to classpath scanning issues.</p></div></div><p>&#160;</p><p>You are welcome to write your own converters. Remember to use the @Converter annotations on the classes and methods you wish to use. Then add the packages to a file called <em>META-INF/services/org/apache/camel/TypeConverter</em> in your jar. Remember to make sure tha
 t :-</p><ul><li>static methods are encouraged to reduce caching, but instance methods are fine, particularly if you want to allow optional dependency injection to customize the converter</li><li>converter methods should be thread safe and reentrant</li></ul><h4 id="TypeConverter-ExamplesofTypeConverterfile">Examples of TypeConverter file</h4><p>The file in the JAR: <code>META-INF/services/org/apache/camel/TypeConverter</code> contains the following line(s)</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[com.foo
 com.bar
 ]]></script>