camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/4] camel git commit: CAMEL-10447 javadoc and some minor fixes
Date Thu, 24 Nov 2016 09:45:23 GMT
Repository: camel
Updated Branches:
  refs/heads/master b65041424 -> 2dcd9b8d1


CAMEL-10447 javadoc and some minor fixes


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2dcd9b8d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2dcd9b8d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2dcd9b8d

Branch: refs/heads/master
Commit: 2dcd9b8d1212b03a59ea16e63affcab7988c2027
Parents: 7ba090f
Author: Tomohisa Igarashi <tm.igarashi@gmail.com>
Authored: Thu Nov 24 00:27:25 2016 +0900
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Nov 24 10:45:13 2016 +0100

----------------------------------------------------------------------
 .../impl/transformer/DataFormatTransformer.java |  5 +--
 .../impl/transformer/ProcessorTransformer.java  | 14 ++++----
 .../apache/camel/model/InputTypeDefinition.java | 14 ++++----
 .../camel/model/OutputTypeDefinition.java       | 14 ++++----
 .../org/apache/camel/model/RouteDefinition.java | 14 ++++----
 .../CustomTransformerDefinition.java            | 17 +++++----
 .../DataFormatTransformerDefinition.java        | 10 ++++--
 .../EndpointTransformerDefinition.java          | 16 ++++++---
 .../transformer/TransformerDefinition.java      | 38 +++++++++-----------
 .../camel/processor/CamelInternalProcessor.java |  7 ++--
 .../java/org/apache/camel/spi/RouteContext.java |  4 +--
 .../java/org/apache/camel/spi/Transformer.java  | 12 +++++--
 .../transformer/TransformerContractTest.java    |  2 --
 13 files changed, 93 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/impl/transformer/DataFormatTransformer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/transformer/DataFormatTransformer.java
b/camel-core/src/main/java/org/apache/camel/impl/transformer/DataFormatTransformer.java
index 9993807..b4e0586 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/transformer/DataFormatTransformer.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/transformer/DataFormatTransformer.java
@@ -34,8 +34,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A <a href="http://camel.apache.org/transformer.html">Transformer</a>
- * leverages DataFormat to perform transformation.
+ * A {@link Transformer} implementation which leverages {@link DataFormat} to perform transformation.
+ * 
+ * {@see Transformer}
  */
 public class DataFormatTransformer extends Transformer {
     private static final Logger LOG = LoggerFactory.getLogger(DataFormatTransformer.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/impl/transformer/ProcessorTransformer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/transformer/ProcessorTransformer.java
b/camel-core/src/main/java/org/apache/camel/impl/transformer/ProcessorTransformer.java
index f7bc2d4..ddacf3d 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/transformer/ProcessorTransformer.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/transformer/ProcessorTransformer.java
@@ -28,12 +28,14 @@ import org.apache.camel.processor.SendProcessor;
 import org.apache.camel.spi.DataType;
 import org.apache.camel.spi.Transformer;
 import org.apache.camel.support.ServiceSupport;
+import org.apache.camel.util.ServiceHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A <a href="http://camel.apache.org/transformer.html">Transformer</a>
- * leverages Processor to perform transformation.
+ * A {@link Transformer} implementation which leverages {@link Processor} to perform transformation.
+ * 
+ * {@see Transformer}
  */
 public class ProcessorTransformer extends Transformer {
     private static final Logger LOG = LoggerFactory.getLogger(ProcessorTransformer.class);
@@ -108,15 +110,11 @@ public class ProcessorTransformer extends Transformer {
 
     @Override
     protected void doStart() throws Exception {
-        if (this.processor instanceof ServiceSupport) {
-            ((ServiceSupport)this.processor).start();
-        }
+        ServiceHelper.startService(this.processor);
     }
 
     @Override
     protected void doStop() throws Exception {
-        if (this.processor instanceof ServiceSupport) {
-            ((ServiceSupport)this.processor).stop();
-        }
+        ServiceHelper.stopService(this.processor);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/model/InputTypeDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/InputTypeDefinition.java b/camel-core/src/main/java/org/apache/camel/model/InputTypeDefinition.java
index 782e041..ade8359 100644
--- a/camel-core/src/main/java/org/apache/camel/model/InputTypeDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/InputTypeDefinition.java
@@ -26,6 +26,13 @@ import org.apache.camel.spi.Metadata;
 
 /**
  * Set data type of the input message.
+ * Type name consists of two parts, 'scheme' and 'name' connected with ':'. For Java type
'name'
+ * is a fully qualified class name. For example {@code java:java.lang.String}, {@code json:ABCOrder}.
+ * It's also possible to specify only scheme part, so that it works like a wildcard. If only
'xml'
+ * is specified, all the XML message matches. It's handy to add only one transformer/validator
+ * for all the transformation from/to XML.
+ * 
+ * {@see OutputTypeDefinition}
  */
 @Metadata(label = "configuration")
 @XmlRootElement(name = "inputType")
@@ -33,8 +40,6 @@ import org.apache.camel.spi.Metadata;
 public class InputTypeDefinition extends OptionalIdentifiedDefinition<InputTypeDefinition>
{
     @XmlAttribute(required = true)
     private String urn;
-    @XmlTransient
-    private Class<?> clazz;
 
     public InputTypeDefinition() {
     }
@@ -44,9 +49,6 @@ public class InputTypeDefinition extends OptionalIdentifiedDefinition<InputTypeD
      * @return input type URN
      */
     public String getUrn() {
-        if (clazz != null) {
-            return "java:" + clazz.getName();
-        }
         return urn;
     }
 
@@ -63,7 +65,7 @@ public class InputTypeDefinition extends OptionalIdentifiedDefinition<InputTypeD
      * @param clazz Java Class
      */
     public void setJavaClass(Class<?> clazz) {
-        this.clazz = clazz;
+        this.urn = "java:" + clazz.getName();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/model/OutputTypeDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/OutputTypeDefinition.java b/camel-core/src/main/java/org/apache/camel/model/OutputTypeDefinition.java
index 755874a..8988ae3 100644
--- a/camel-core/src/main/java/org/apache/camel/model/OutputTypeDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/OutputTypeDefinition.java
@@ -26,6 +26,13 @@ import org.apache.camel.spi.Metadata;
 
 /**
  * Sets data type of the output message.
+ * Type name consists of two parts, 'scheme' and 'name' connected with ':'. For Java type
'name'
+ * is a fully qualified class name. For example {@code java:java.lang.String}, {@code json:ABCOrder}.
+ * It's also possible to specify only scheme part, so that it works like a wildcard. If only
'xml'
+ * is specified, all the XML message matches. It's handy to add only one transformer/validator
+ * for all the XML-Java transformation.
+ * 
+ * {@see InputTypeDefinition}
  */
 @Metadata(label = "configuration")
 @XmlRootElement(name = "outputType")
@@ -33,8 +40,6 @@ import org.apache.camel.spi.Metadata;
 public class OutputTypeDefinition extends OptionalIdentifiedDefinition<OutputTypeDefinition>
{
     @XmlAttribute(required = true)
     private String urn;
-    @XmlTransient
-    private Class<?> clazz;
 
     public OutputTypeDefinition() {
     }
@@ -44,9 +49,6 @@ public class OutputTypeDefinition extends OptionalIdentifiedDefinition<OutputTyp
      * @return output type URN
      */
     public String getUrn() {
-        if (clazz != null) {
-            return "java:" + clazz.getName();
-        }
         return urn;
     }
 
@@ -64,7 +66,7 @@ public class OutputTypeDefinition extends OptionalIdentifiedDefinition<OutputTyp
      * @param clazz Java Class
      */
     public void setJavaClass(Class<?> clazz) {
-        this.clazz = clazz;
+        this.urn = "java:" + clazz.getName();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java b/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java
index e140dc0..76b4ec3 100644
--- a/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java
@@ -634,12 +634,12 @@ public class RouteDefinition extends ProcessorDefinition<RouteDefinition>
{
 
     /**
      * Declare an input type.
-     * @param name input type URN
+     * @param urn input type URN
      * @return the builder
      */
-    public RouteDefinition inputType(String name) {
+    public RouteDefinition inputType(String urn) {
         inputType = new InputTypeDefinition();
-        inputType.setUrn(name);
+        inputType.setUrn(urn);
         return this;
     }
 
@@ -656,17 +656,17 @@ public class RouteDefinition extends ProcessorDefinition<RouteDefinition>
{
 
     /**
      * Declare an output type.
-     * @param name output type URN
+     * @param urn output type URN
      * @return the builder
      */
-    public RouteDefinition outputType(String name) {
+    public RouteDefinition outputType(String urn) {
         outputType = new OutputTypeDefinition();
-        outputType.setUrn(name);
+        outputType.setUrn(urn);
         return this;
     }
 
     /**
-     * Declare an output type.
+     * Declare an output type with Java class.
      * @param clazz Class object of the output type
      * @return the builder
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/model/transformer/CustomTransformerDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/transformer/CustomTransformerDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/transformer/CustomTransformerDefinition.java
index 3af804b..029c6f4 100644
--- a/camel-core/src/main/java/org/apache/camel/model/transformer/CustomTransformerDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/transformer/CustomTransformerDefinition.java
@@ -40,7 +40,11 @@ import org.apache.camel.spi.Transformer;
 import org.apache.camel.util.ObjectHelper;
 
 /**
- * Represents a BeanTransformer.
+ * Represents a CustomTransformer. One of the bean reference (ref) or fully qualified class
name (type)
+ * of the custom {@link Transformer} needs to be specified.
+ * 
+ * {@see TransformerDefinition}
+ * {@see Transformer}
  */
 @Metadata(label = "transformation")
 @XmlType(name = "customTransformer")
@@ -52,13 +56,13 @@ public class CustomTransformerDefinition extends TransformerDefinition
{
     private String type;
 
     @Override
-    protected Transformer doCreateTransformer() throws Exception {
+    protected Transformer doCreateTransformer(CamelContext context) throws Exception {
         if (ref == null && type == null) {
             throw new IllegalArgumentException("'ref' or 'type' must be specified for customTransformer");
         }
         Transformer transformer;
         if (ref != null) {
-            transformer = getCamelContext().getRegistry().lookupByNameAndType(ref, Transformer.class);
+            transformer = context.getRegistry().lookupByNameAndType(ref, Transformer.class);
             if (transformer == null) {
                 throw new IllegalArgumentException("Cannot find transformer with ref:" +
ref);
             }
@@ -66,13 +70,14 @@ public class CustomTransformerDefinition extends TransformerDefinition
{
                 throw new IllegalArgumentException(String.format("Transformer '%s' is already
in use. Please check if duplicate transformer exists.", ref));
             }
         } else {
-            Class<Transformer> transformerClass = getCamelContext().getClassResolver().resolveMandatoryClass(type,
Transformer.class);
+            Class<Transformer> transformerClass = context.getClassResolver().resolveMandatoryClass(type,
Transformer.class);
             if (transformerClass == null) {
                 throw new IllegalArgumentException("Cannot find transformer class: " + type);
             }
-            transformer = transformerClass.newInstance();
+            transformer = context.getInjector().newInstance(transformerClass);
+
         }
-        transformer.setCamelContext(getCamelContext());
+        transformer.setCamelContext(context);
         return transformer.setModel(getScheme())
                           .setFrom(getFrom())
                           .setTo(getTo());

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
index 6429b85..191b985 100644
--- a/camel-core/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/transformer/DataFormatTransformerDefinition.java
@@ -74,7 +74,11 @@ import org.apache.camel.spi.RouteContext;
 import org.apache.camel.spi.Transformer;
 
 /**
- * Represents a DataFormatTransformer.
+ * Represents a {@link DataFormatTransformer} which leverages {@link DataFormat} to perform
+ * transformation. One of the DataFormat 'ref' or DataFormat 'type' needs to be specified.
+ * 
+ * {@see TransformerDefinition}
+ * {@see DataFormatTransformer}
  */
 @Metadata(label = "transformation")
 @XmlType(name = "dataFormatTransformer")
@@ -125,8 +129,8 @@ public class DataFormatTransformerDefinition extends TransformerDefinition
{
     private String ref;
 
     @Override
-    protected Transformer doCreateTransformer() {
-        return new DataFormatTransformer(getCamelContext())
+    protected Transformer doCreateTransformer(CamelContext context) {
+        return new DataFormatTransformer(context)
                 .setDataFormatType(dataFormatType)
                 .setDataFormatRef(ref)
                 .setModel(getScheme())

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/model/transformer/EndpointTransformerDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/transformer/EndpointTransformerDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/transformer/EndpointTransformerDefinition.java
index 7b16fc4..eb18e0b 100644
--- a/camel-core/src/main/java/org/apache/camel/model/transformer/EndpointTransformerDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/transformer/EndpointTransformerDefinition.java
@@ -36,7 +36,13 @@ import org.apache.camel.spi.RouteContext;
 import org.apache.camel.spi.Transformer;
 
 /**
- * Represents a EndpointTransformer.
+ * Represents an endpoint {@link Transformer} which leverages camel {@link Endpoint} to
+ * perform transformation. A {@link ProcessorTransformer} will be created internally
+ * with a {@link SendProcessor} which forwards the message to the specified Endpoint.
+ * One of the Endpoint 'ref' or 'uri' needs to be specified.
+ * 
+ * {@see TransformerDefinition}
+ * {@see ProcessorTransformer}
  */
 @Metadata(label = "transformation")
 @XmlType(name = "endpointTransformer")
@@ -49,11 +55,11 @@ public class EndpointTransformerDefinition extends TransformerDefinition
{
     private String uri;
 
     @Override
-    protected Transformer doCreateTransformer() throws Exception {
-        Endpoint endpoint = uri != null ? getCamelContext().getEndpoint(uri)
-            : getCamelContext().getRegistry().lookupByNameAndType(ref, Endpoint.class);
+    protected Transformer doCreateTransformer(CamelContext context) throws Exception {
+        Endpoint endpoint = uri != null ? context.getEndpoint(uri)
+            : context.getRegistry().lookupByNameAndType(ref, Endpoint.class);
         SendProcessor processor = new SendProcessor(endpoint, ExchangePattern.InOut);
-        return new ProcessorTransformer(getCamelContext())
+        return new ProcessorTransformer(context)
             .setProcessor(processor)
             .setModel(getScheme())
             .setFrom(getFrom())

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/model/transformer/TransformerDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/transformer/TransformerDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/transformer/TransformerDefinition.java
index 7695a63..da24804 100644
--- a/camel-core/src/main/java/org/apache/camel/model/transformer/TransformerDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/transformer/TransformerDefinition.java
@@ -39,7 +39,20 @@ import org.apache.camel.util.ObjectHelper;
 import static org.apache.camel.util.EndpointHelper.isReferenceParameter;
 
 /**
- * Represents a Transformer.
+ * <p>Represents a {@link Transformer} which declaratively transforms message content
+ * according to the input type declared by {@link InputTypeDefinition} and/or output type
+ * declared by {@link OutputTypeDefinition}.</p>
+ * <p>If you specify from='java:com.example.ABC' and to='xml:XYZ', the transformer
+ * will be picked up when current message type is 'java:com.example.ABC' and expected
+ * message type is 'xml:XYZ'.
+ * If you specify from='java' to='xml', then it will be picked up for all of java
+ * to xml transformation.
+ * Also it's possible to specify scheme='xml' so that the transformer will be picked up
+ * for all of java to xml and xml to java transformation.</p>
+ * 
+ * {@see Transformer}
+ * {@see InputTypeDefinition}
+ * {@see OutputTypeDefinition}
  */
 @Metadata(label = "transformation")
 @XmlType(name = "transformer")
@@ -51,15 +64,12 @@ public abstract class TransformerDefinition {
     private String from;
     @XmlAttribute
     private String to;
-    @XmlTransient
-    private CamelContext camelContext;
 
     public Transformer createTransformer(CamelContext context) throws Exception {
-        this.camelContext = context;
-        return doCreateTransformer();
+        return doCreateTransformer(context);
     };
 
-    protected abstract Transformer doCreateTransformer() throws Exception;
+    protected abstract Transformer doCreateTransformer(CamelContext context) throws Exception;
 
     public String getScheme() {
         return scheme;
@@ -113,21 +123,5 @@ public abstract class TransformerDefinition {
         this.to = "java:" + clazz.getName();
     }
 
-    /**
-     * Get the CamelContext.
-     * @return
-     */
-    public CamelContext getCamelContext() {
-        return camelContext;
-    }
-
-    /**
-     * Set the CamelContext.
-     * @param camelContext CamelContext
-     */
-    public void setCamelContext(CamelContext camelContext) {
-        this.camelContext = camelContext;
-    }
-
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
b/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
index ab9892a..723bab3 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
@@ -68,6 +68,7 @@ import org.slf4j.LoggerFactory;
  *     <li>Debugging</li>
  *     <li>Message History</li>
  *     <li>Stream Caching</li>
+ *     <li>{@link Transformer}</li>
  * </ul>
  * ... and more.
  * <p/>
@@ -875,7 +876,7 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor {
             DataType to = contract.getInputType();
             if (to != null && !to.equals(from)) {
                 LOG.debug("Looking for transformer for INPUT: from='{}', to='{}'", from,
to);
-                convertBody(exchange.getIn(), from, to);
+                doTransform(exchange.getIn(), from, to);
                 exchange.setProperty(Exchange.INPUT_TYPE, to);
             }
             return null;
@@ -888,12 +889,12 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor {
             DataType to = contract.getOutputType();
             if (to != null && !to.equals(from)) {
                 LOG.debug("Looking for transformer for OUTPUT: from='{}', to='{}'", from,
to);
-                convertBody(target, from, to);
+                doTransform(target, from, to);
                 exchange.setProperty(exchange.hasOut() ? Exchange.OUTPUT_TYPE : Exchange.INPUT_TYPE,
to);
             }
         }
         
-        private static void convertBody(Message message, DataType from, DataType to) throws
Exception {
+        private static void doTransform(Message message, DataType from, DataType to) throws
Exception {
             CamelContext context = message.getExchange().getContext();
             // transform into 'from' type before performing declared transformation
             if (from != null && from.isJavaType() && from.getName() != null)
{

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java b/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
index 194f544..ce57112 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/RouteContext.java
@@ -193,8 +193,8 @@ public interface RouteContext extends RuntimeConfiguration, EndpointAware
{
     int getAndIncrement(ProcessorDefinition<?> node);
 
     /**
-     * 
-     * @param contract
+     * Sets a {@link Contract} which declares input/output message type on the route.
+     * @param contract {@link Contract} for this route
      */
     void setContract(Contract contract);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/main/java/org/apache/camel/spi/Transformer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/Transformer.java b/camel-core/src/main/java/org/apache/camel/spi/Transformer.java
index adee678..d179556 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/Transformer.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/Transformer.java
@@ -29,8 +29,16 @@ import org.slf4j.LoggerFactory;
 
 /**
  * <a href="http://camel.apache.org/transformer.html">Transformer</a>
- * represents Any to Any data transformation which leverages data format and endpoint
- * under the cover.
+ * performs message transformation according to the declared data type.
+ * There are two Exchange property indicates current message type, {@link Exchange.INPUT_TYPE}
+ * holds input message type and {@link Exchange.OUTPUT_TYPE} holds output message type. If
the
+ * input type and/or output type declared by {@link InputTypeDefinition}
+ * and/or {@link OutputTypeDefinition} in the route definition is different from those property
+ * at runtime, camel internal processor look for a Transformer which transforms from
+ * the current message type to the expected message type.
+ *  
+ *  {@see InputTypeDefinition}
+ *  {@see OutputTypeDefinition}
  */
 public abstract class Transformer extends ServiceSupport implements CamelContextAware {
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2dcd9b8d/camel-core/src/test/java/org/apache/camel/impl/transformer/TransformerContractTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/transformer/TransformerContractTest.java
b/camel-core/src/test/java/org/apache/camel/impl/transformer/TransformerContractTest.java
index 263afd1..0a3d7e4 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/transformer/TransformerContractTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/transformer/TransformerContractTest.java
@@ -37,8 +37,6 @@ import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.RouteContext;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
-
 public class TransformerContractTest extends ContextTestSupport {
 
     @Override


Mime
View raw message