1 /*
2 * $Id: OutboundAttachments.java 20813 2010-12-21 11:37:48Z dirk.olmes $
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 org.mule.api.annotations.meta.Evaluator;
14
15 import java.lang.annotation.Documented;
16 import java.lang.annotation.ElementType;
17 import java.lang.annotation.Retention;
18 import java.lang.annotation.RetentionPolicy;
19 import java.lang.annotation.Target;
20
21 /**
22 * <p>
23 * Used on component methods, this parameter annotation passes in a reference to a
24 * {@link java.util.Map} that can be used to populate outbound attachments that will
25 * be set with the outgoing message. For example, when sending an email message, you
26 * may want to add attachments such as images or documents.
27 * </p>
28 * <p>
29 * This annotation must only be defined on a parameter of type {@link java.util.Map}.
30 * The elements in the map will be of type {@link javax.activation.DataHandler}, thus
31 * the annotated parameter should be defined as
32 * <code>java.util.Map<java.lang.String, javax.activation.DataHandler></code>
33 * where the key is the attachment name and the value is the handler for the
34 * attachment.
35 */
36 @Target(ElementType.PARAMETER)
37 @Retention(RetentionPolicy.RUNTIME)
38 @Documented
39 @Evaluator("outboundAttachments")
40 public @interface OutboundAttachments
41 {
42 // no custom methods
43 }