View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.api.annotations.param;
8   
9   import java.util.HashMap;
10  import java.util.List;
11  import java.util.Map;
12  
13  import javax.activation.DataHandler;
14  
15  /**
16   * A component for testing invocations with more than one parameter
17   */
18  public class MixedAnnotationsComponent
19  {
20      public Map<?, ?> processAllAnnotated(@Payload String payload, 
21          @InboundHeaders("foo, bar") Map<?, ?> headers, 
22          @InboundAttachments("*") Map<String, DataHandler> attachments)
23      {
24          Map<String, Object> m = new HashMap<String, Object>(3);
25          m.put("payload", payload);
26          m.put("inboundHeaders", headers);
27          m.put("inboundAttachments", attachments);
28          return m;
29      }
30  
31      public Map<?, ?> processPayloadNotAnnotated(String payload, 
32          @InboundHeaders("foo, bar") Map<?, ?> headers, 
33          @InboundAttachments("*") List<DataHandler> attachments)
34      {
35          Map<String, Object> m = new HashMap<String, Object>(3);
36          m.put("payload", payload);
37          m.put("inboundHeaders", headers);
38          m.put("inboundAttachments", attachments);
39          return m;
40      }
41  }