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.

Since:
3.0

Field Summary
static DataType<String> ATOM_STRING
           
static DataType<String> BYTE_ARRAY
           
static DataType<String> HTML_STRING
           
static DataType<String> INPUT_STREAM
           
static DataType<String> JSON_STRING
           
static DataType<String> MULE_MESSAGE
           
static DataType<String> OBJECT
           
static DataType<String> RSS_STRING
           
static DataType<String> STRING
           
static DataType<String> TEXT_STRING
           
static DataType<String> XML_STRING
           
 
Constructor Summary
DataTypeFactory()
           
 
Method Summary
static
<T> DataType
create(Class<? extends Collection> collClass, Class<T> itemType)
           
static
<T> DataType
create(Class<? extends Collection> collClass, Class<T> itemType, String mimeType)
           
static
<T> DataType<T>
create(Class<T> type)
           
static
<T> DataType<T>
create(Class<T> type, String mimeType)
           
static DataType<?> createFromField(Field f)
           
static DataType<?> createFromField(Field f, String mimeType)
           
static DataType<?> createFromObject(Object o)
          Will create a DataType object from an object instance.
static DataType createFromParameterType(Method m, int paramIndex)
           
static DataType createFromParameterType(Method m, int paramIndex, String mimeType)
           
static DataType<?> createFromReturnType(Method m)
           
static DataType<?> createFromReturnType(Method m, String mimeType)
           
static
<T> DataType<T>
createImmutable(Class<T> type)
           
static
<T> DataType<T>
createWithEncoding(Class<T> type, String encoding)
           
protected static
<T> boolean
isProxyClass(Class<T> type)
          Cache which classes are proxies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_STRING

public static final DataType<String> TEXT_STRING

XML_STRING

public static final DataType<String> XML_STRING

JSON_STRING

public static final DataType<String> JSON_STRING

HTML_STRING

public static final DataType<String> HTML_STRING

ATOM_STRING

public static final DataType<String> ATOM_STRING

RSS_STRING

public static final DataType<String> RSS_STRING

STRING

public static final DataType<String> STRING

OBJECT

public static final DataType<String> OBJECT

BYTE_ARRAY

public static final DataType<String> BYTE_ARRAY

INPUT_STREAM

public static final DataType<String> INPUT_STREAM

MULE_MESSAGE

public static final DataType<String> MULE_MESSAGE
Constructor Detail

DataTypeFactory

public DataTypeFactory()
Method Detail

create

public static <T> DataType<T> create(Class<T> type)

createImmutable

public static <T> DataType<T> createImmutable(Class<T> type)

createWithEncoding

public static <T> DataType<T> createWithEncoding(Class<T> type,
                                                 String encoding)

create

public static <T> DataType<T> create(Class<T> type,
                                     String mimeType)

create

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

create

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

createFromObject

public static 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 static DataType<?> createFromReturnType(Method m)

createFromReturnType

public static DataType<?> createFromReturnType(Method m,
                                               String mimeType)

createFromParameterType

public static DataType createFromParameterType(Method m,
                                               int paramIndex)

createFromParameterType

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

createFromField

public static DataType<?> createFromField(Field f)

createFromField

public static DataType<?> createFromField(Field f,
                                          String mimeType)

isProxyClass

protected static <T> boolean isProxyClass(Class<T> type)
Cache which classes are proxies. Very experimental



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