Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.databinding.extension
Class DataBindingExtension

java.lang.Object
  extended by org.apache.tuscany.spi.databinding.extension.DataBindingExtension
All Implemented Interfaces:
DataBinding

public abstract class DataBindingExtension
extends Object
implements DataBinding

Base Implementation of DataBinding


Field Summary
protected  Class<?> baseType
           
protected  String name
           
protected  DataBindingRegistry registry
           
 
Constructor Summary
protected DataBindingExtension(Class<?> baseType)
          Create a databinding with the base java type whose name will be used as the name of the databinding
protected DataBindingExtension(String name, Class<?> baseType)
          Create a databinding with the name and base java type
 
Method Summary
 String getName()
          The name of a databinding should be case-insensitive and unique
 WrapperHandler getWrapperHandler()
          Provide a WrapperHandler for this databinding
 void init()
           
 DataType introspect(Class<?> javaType)
          Introspect a java class or interface to create a DataType model
 DataType introspect(Object value)
          Introspect the data to figure out the corresponding data type
 void setDataBindingRegistry(DataBindingRegistry registry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

registry

protected DataBindingRegistry registry

baseType

protected Class<?> baseType

name

protected String name
Constructor Detail

DataBindingExtension

protected DataBindingExtension(Class<?> baseType)
Create a databinding with the base java type whose name will be used as the name of the databinding

Parameters:
baseType - The base java class or interface representing the databinding, for example, org.w3c.dom.Node

DataBindingExtension

protected DataBindingExtension(String name,
                               Class<?> baseType)
Create a databinding with the name and base java type

Parameters:
name - The name of the databinding
baseType - The base java class or interface representing the databinding, for example, org.w3c.dom.Node
Method Detail

setDataBindingRegistry

public void setDataBindingRegistry(DataBindingRegistry registry)

init

public void init()

introspect

public DataType introspect(Class<?> javaType)
Description copied from interface: DataBinding
Introspect a java class or interface to create a DataType model

Specified by:
introspect in interface DataBinding
Parameters:
javaType - The java class or interface to be introspected
Returns:
The DataType or null if the java type is not supported by this databinding

introspect

public DataType introspect(Object value)
Description copied from interface: DataBinding
Introspect the data to figure out the corresponding data type

Specified by:
introspect in interface DataBinding
Parameters:
value - The object to be checked
Returns:
The DataType or null if the java type is not supported by this databinding

getName

public final String getName()
Description copied from interface: DataBinding
The name of a databinding should be case-insensitive and unique

Specified by:
getName in interface DataBinding
Returns:
The name of the databinding

getWrapperHandler

public WrapperHandler getWrapperHandler()
Description copied from interface: DataBinding
Provide a WrapperHandler for this databinding

Specified by:
getWrapperHandler in interface DataBinding
Returns:
A wrapper handler which can handle wrapping/wrapping for this databinding
See Also:
DataBinding.getWrapperHandler()

Apache Tuscany SCA Kernel Sub-Project

-