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

All Known Implementing Classes:
CollectionDataType, ListDataType, SetDataType, SimpleDataType

public interface DataType<T>

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
           
 
Method Summary
 String getMimeType()
          The mime type of the the source object to transform.
 Class<T> 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 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
Method Detail

getType

Class<T> 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

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.


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