org.apache.tuscany.sca.interfacedef
Interface DataType<L>

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
DataTypeImpl, GeneratedDataTypeImpl

public interface DataType<L>
extends java.lang.Cloneable

Representation of the type of data associated with an operation. Data is represented in two forms: the physical form used by the runtime and a logical form used by the assembly. The physical form is a Java Type because the runtime is written in Java. This may be the same form used by the application but it may not; for example, an application that is performing stream processing may want a physical form such as an InputStream to semantially operate on application data such as a purchase order. The logical description is that used by the assembly model and is an identifier into some well-known type space; examples may be a Java type represented by its Class or an XML type represented by its QName. Every data type may also contain metadata describing the expected data; for example, it could specify a preferred data binding technology or the size of a typical instance.


Method Summary
 java.lang.Object clone()
          Clone a data type
 java.lang.String getDataBinding()
          Get the databinding for the given data type
 java.lang.reflect.Type getGenericType()
          Get the java generic type
 L getLogical()
          Returns the logical identifier used by the assembly.
<T> T
getMetaData(java.lang.Class<T> type)
          Get the databinding-specific metadata
 java.lang.Class<?> getPhysical()
          Returns the physical type used by the runtime.
 void setDataBinding(java.lang.String dataBinding)
          Set the databinding for the given data type
 void setGenericType(java.lang.reflect.Type genericType)
          Set the java generic type
 void setLogical(L logical)
          Set the logical type of the data type
<T> void
setMetaData(java.lang.Class<T> type, T metaData)
          Set the databinding-specific metadata
 void setPhysical(java.lang.Class<?> cls)
          Set the java type for the data
 

Method Detail

setPhysical

void setPhysical(java.lang.Class<?> cls)
Set the java type for the data

Parameters:
cls -

getPhysical

java.lang.Class<?> getPhysical()
Returns the physical type used by the runtime.

Returns:
the physical type used by the runtime

getGenericType

java.lang.reflect.Type getGenericType()
Get the java generic type

Returns:
The java generic type

setGenericType

void setGenericType(java.lang.reflect.Type genericType)
Set the java generic type

Parameters:
genericType -

getLogical

L getLogical()
Returns the logical identifier used by the assembly. The type of this value identifies the logical type system in use. Known values are:

Returns:
the logical type name

getDataBinding

java.lang.String getDataBinding()
Get the databinding for the given data type

Returns:
the databinding

setDataBinding

void setDataBinding(java.lang.String dataBinding)
Set the databinding for the given data type

Parameters:
dataBinding - the dataBinding to set

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone a data type

Returns:
The cloned data type
Throws:
java.lang.CloneNotSupportedException

setLogical

void setLogical(L logical)
Set the logical type of the data type

Parameters:
logical - the logical to set

getMetaData

<T> T getMetaData(java.lang.Class<T> type)
Get the databinding-specific metadata

Parameters:
type - The java type of the metadata
Returns:
the databinding-specific metadata

setMetaData

<T> void setMetaData(java.lang.Class<T> type,
                     T metaData)
Set the databinding-specific metadata

Parameters:
type - The java type of the metadata
metaData - the databinding-specific metadata, such as SDO's commonj.sdo.Type or JAXB's javax.xml.bind.JAXBContext