View Javadoc

1   /*
2    * $Id: PayloadAnnotationComponent.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.api.annotations.param;
12  
13  import java.io.InputStream;
14  
15  /**
16   * Test cases where the Payload annotation can be used to specify the parameter to inject the payload of the message, including
17   * doing automatic transforms
18   */
19  public class PayloadAnnotationComponent
20  {
21      //No transform needed
22      public String processNoTransformString(@Payload String payload)
23      {
24          return payload;
25      }
26  
27      //Auto transform from String to InputStream
28      public InputStream processAutoTransformString(@Payload InputStream payload)
29      {
30          return payload;
31      }
32  
33      //There is no transformer to go from String to StringBuffer
34      public Object processFailedAutoTransformString(@Payload StringBuffer payload)
35      {
36          return payload;
37      }
38  }