org.mule.api.annotations.param
Annotation Type InboundAttachments
@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface InboundAttachments
Used on component and transformer methods that have a Transformer
annotation.
This annotation marks the method parameter that will be used to pass in one or more of the received attachments.
This annotation can define a single attachment, a comma-separated list of attachment names, or '*' to denote all headers. By default,
if a named header is not present, an exception will be thrown. However, if the header name is defined with the '?' post fix, it
will be marked as optional.
When defining multiple attachment names i.e. InboundAttachments("shipping-slip.pdf, customer-record.xml") or using the '*' wildcard to denote all attachments,
or wildcard expressions can be used, such as '*.pdf' or multiple patterns such as '*.pdf, *.xml'.
the parameter can be a Map
or List
. If a Map
is used, the header name and value is passed in.
If List
is used, just the header value is used. If a single header name is defined, the header type can be used as the parameter or
List
or Map
can be used too. Entry type for collections is DataHandler
.
The Inbound attachments collection is immutable, so the attachments Map or List passed in will be immutable too. Attempting to write to the Map or List will result in an UnsupportedOperationException
.
Required Element Summary |
String |
value
Defines the headers that should be injected into the parameter. |
value
public abstract String value
- Defines the headers that should be injected into the parameter. This can be a single header, a comma-separated
list of header names, or '*' to denote all headers or a comma separated list of wildcard expressions such as '*.pdf, *.xml'.
By default, if a named header is not present, an exception will
be thrown. However, if the header name is defined with the '?' post fix, it will be marked as optional. When using wildcard expressions
the optional '?' postfix cannot be used.
- Returns:
- the attachment expression used to query the message
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.