1
2
3
4
5
6
7 package org.mule.api.annotations.param;
8
9 import org.mule.util.StringDataSource;
10
11 import java.util.List;
12 import java.util.Map;
13
14 import javax.activation.DataHandler;
15
16
17
18
19
20 public class OutboundAttachmentsAnnotationComponent
21 {
22 public Map<?, ?> processAttachments(@OutboundAttachments Map<String, DataHandler> attachments)
23 {
24 attachments.put("bar", new DataHandler(new StringDataSource("barValue")));
25
26 if (attachments.containsKey("foo"))
27 {
28
29 attachments.put("foo", new DataHandler(new StringDataSource("fooValue")));
30 }
31 return attachments;
32 }
33
34
35 public List<?> invalidParamType(@OutboundAttachments List<?> attachments)
36 {
37 return attachments;
38 }
39 }