org.mule.transformer.types
Class DataTypeFactory

java.lang.Object
  extended by org.mule.transformer.types.DataTypeFactory

public class DataTypeFactory
extends Object

Factory class used to create DataType objects based on the parameter types passed into the factory methods.


Constructor Summary
DataTypeFactory()
           
 
Method Summary
 DataType create(Class type)
           
 DataType create(Class<? extends Collection> collClass, Class itemType)
           
 DataType create(Class<? extends Collection> collClass, Class itemType, String mimeType)
           
 DataType create(Class type, String mimeType)
           
 DataType createFromField(Field f)
           
 DataType createFromField(Field f, String mimeType)
           
 DataType createFromObject(Object o)
          Will create a DataType object from an object instance.
 DataType createFromParameterType(Method m, int paramIndex)
           
 DataType createFromParameterType(Method m, int paramIndex, String mimeType)
           
 DataType createFromReturnType(Method m)
           
 DataType createFromReturnType(Method m, String mimeType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeFactory

public DataTypeFactory()
Method Detail

create

public DataType create(Class type)

create

public DataType create(Class type,
                       String mimeType)

create

public DataType create(Class<? extends Collection> collClass,
                       Class itemType)

create

public DataType create(Class<? extends Collection> collClass,
                       Class itemType,
                       String mimeType)

createFromObject

public DataType createFromObject(Object o)
Will create a DataType object from an object instance. This method will check if the object o is a MuleMessage instance and will take the type from the message payload and check if a mime type is set on the message and used that when constructing the DataType object.

Parameters:
o - an object instance. This can be a MuleMessage, a collection, a proxy instance or any other object
Returns:
a data type that represents the object type.

createFromReturnType

public DataType createFromReturnType(Method m)

createFromReturnType

public DataType createFromReturnType(Method m,
                                     String mimeType)

createFromParameterType

public DataType createFromParameterType(Method m,
                                        int paramIndex)

createFromParameterType

public DataType createFromParameterType(Method m,
                                        int paramIndex,
                                        String mimeType)

createFromField

public DataType createFromField(Field f)

createFromField

public DataType createFromField(Field f,
                                String mimeType)


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.