Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

MIME Type and Encoding

In Mule 3.7 and newer, you can define the MIME type and encoding of a given return object from @Processor. See the Anypoint DevKit API Reference for more information on annotations.

While DevKit has the @Mime annotation, that element fetches that information at compile time, it’s not useful when the connector implements proxy or wrapping to a filesystem type of API.

Runtime Support

This feature lets you customize a return type. The following example shows how to trigger this feature:


         
      
1
2
@Processor
@UserDefinedMetaData

Anypoint Studio Support

If the @Processor is annotated with @UserDefinedMetaData (which is not mandatory when using TransformingValue). That attribute helps Studio users change the metadata of the given processor in later usages if needed.

When enabled, an end user of Studio sees the Metadata tab in Studio that enables the user to change information for Metadata propagation as shown below.

Code example:


         
      
1
2
3
4
5
6
7
8
9
10
11
...
import org.mule.api.annotations.display.UserDefinedMetaData;
...
@Connector(name = "file-chooser", friendlyName="File Chooser")
public class FileChooserConnector {
    @Config
    ConnectorConnectionStrategy connectionStrategy;
    @Processor(friendlyName="Open File as InputStream")
    @UserDefinedMetaData
    public TransformingValue<InputStream,DataType<InputStream>> openFileAsIS(
    ...

Metadata tab:

MetadataTab