org.mule.api.transformer
Interface DataType<T>

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
CollectionDataType, ListDataType, SetDataType, SimpleDataType

public interface DataType<T>
extends Serializable, Cloneable

Defines a Java type associated with additional information about the data. This may be a mime type for the type or for collections, the collection item type can be stored with the collection type.

Since:
3.0.0

Field Summary
static String ANY_MIME_TYPE
           
static DataType<byte[]> BYTE_ARRAY_DATA_TYPE
           
static DataType<String> STRING_DATA_TYPE
           
 
Method Summary
 DataType cloneDataType()
          Create an exact copy of this datatype
 String getEncoding()
          The encoding for the object to transform
 String getMimeType()
          The mime type of the the source object to transform.
 Class<?> getType()
          The object type of the source object to transform.
 boolean isCompatibleWith(DataType dataType)
          Used to determine if this data type is compatible with the data type passed in.
 void setEncoding(String encoding)
          The encoding for the object to transform
 void setMimeType(String mimeType)
          The mime type of the the source object to transform.
 

Field Detail

ANY_MIME_TYPE

static final String ANY_MIME_TYPE
See Also:
Constant Field Values

BYTE_ARRAY_DATA_TYPE

static final DataType<byte[]> BYTE_ARRAY_DATA_TYPE

STRING_DATA_TYPE

static final DataType<String> STRING_DATA_TYPE
Method Detail

getType

Class<?> getType()
The object type of the source object to transform.

Returns:
the class object of the source object. This must not be null

getMimeType

String getMimeType()
The mime type of the the source object to transform.

Returns:
the mime type of the source object. This may be null if the mime type is not known, or if the mime type is not needed

getEncoding

String getEncoding()
The encoding for the object to transform


setEncoding

void setEncoding(String encoding)
The encoding for the object to transform


setMimeType

void setMimeType(String mimeType)
The mime type of the the source object to transform.

Parameters:
mimeType - the mime type of the source object. This may be null if the mime type is not known, or if the mime type is not needed

isCompatibleWith

boolean isCompatibleWith(DataType dataType)
Used to determine if this data type is compatible with the data type passed in. This checks to see if the mime types are equal and whether the Java types are assignable

Parameters:
dataType - the dataType object to compare with
Returns:
true if the mime types are the same and this type can be assigned to the dataType.type.

cloneDataType

DataType cloneDataType()
Create an exact copy of this datatype



Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.