Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.model
Class DataType<L>

java.lang.Object
  extended by org.apache.tuscany.spi.model.ModelObject
      extended by org.apache.tuscany.spi.model.DataType<L>

public class DataType<L>
extends ModelObject

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.

Version:
$Rev: 453987 $ $Date: 2006-10-07 11:53:52 -0700 (Sat, 07 Oct 2006) $

Constructor Summary
DataType(String dataBinding, Type physical, L logical)
           
DataType(Type physical, L logical)
          Construct a data type specifying the physical and logical types.
 
Method Summary
 boolean equals(Object o)
           
 String getDataBinding()
           
 L getLogical()
          Returns the logical identifier used by the assembly.
 Map<String,?> getMetadata()
          Returns all metadata about this type.
 Object getMetadata(String name)
          Returns the specified metadata item or null if not present.
 Type getPhysical()
          Returns the physical type used by the runtime.
 int hashCode()
           
 void setDataBinding(String dataBinding)
           
 Object setMetadata(String name, Object value)
          Sets the specified metadata value.
 String toString()
           
 
Methods inherited from class org.apache.tuscany.spi.model.ModelObject
getExtensions
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataType

public DataType(Type physical,
                L logical)
Construct a data type specifying the physical and logical types.

Parameters:
physical - the physical class used by the runtime
logical - the logical type
See Also:
getLogical()

DataType

public DataType(String dataBinding,
                Type physical,
                L logical)
Method Detail

getPhysical

public Type getPhysical()
Returns the physical type used by the runtime.

Returns:
the physical type used by the runtime

getLogical

public 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

getMetadata

public Map<String,?> getMetadata()
Returns all metadata about this type.

Returns:
all metadata about this type

getMetadata

public Object getMetadata(String name)
Returns the specified metadata item or null if not present.

Parameters:
name - the name of the metadata item
Returns:
the value, or null if not present

setMetadata

public Object setMetadata(String name,
                          Object value)
Sets the specified metadata value. A null value undefines it.

Parameters:
name - the name of the metadata item
value - the value, or null to undefine
Returns:
the old value for the item, or null if not present

getDataBinding

public String getDataBinding()

setDataBinding

public void setDataBinding(String dataBinding)
Parameters:
dataBinding - the dataBinding to set

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

Apache Tuscany SCA Kernel Sub-Project

-