org.apache.tuscany.sca.databinding.impl
Class BaseDataBinding

java.lang.Object
  extended by org.apache.tuscany.sca.databinding.impl.BaseDataBinding
All Implemented Interfaces:
DataBinding
Direct Known Subclasses:
AxiomDataBinding, CallableReferenceDataBinding, DOMDataBinding, ExternalizableDataBinding, GroupDataBinding, JavaBeansDataBinding, JAXBDataBinding, JobDataBinding, JSONDataBinding, SaxonNodeDataBinding, SaxonValueDataBinding, SDODataBinding, SimpleJavaDataBinding, StAXDataBinding, XMLBeansDataBinding, XMLStringDataBinding, XObjectDataBinding

public abstract class BaseDataBinding
extends java.lang.Object
implements DataBinding

Base Implementation of DataBinding


Field Summary
 
Fields inherited from interface org.apache.tuscany.sca.databinding.DataBinding
IDL_FAULT, IDL_INPUT, IDL_OUTPUT
 
Constructor Summary
protected BaseDataBinding(java.lang.Class<?> baseType)
          Create a databinding with the base java type whose name will be used as the name of the databinding
protected BaseDataBinding(java.lang.String name, java.lang.Class<?> baseType)
          Create a databinding with the name and base java type
 
Method Summary
 java.lang.Object copy(java.lang.Object object, DataType dataType, Operation operation)
          Make a copy of the object for "pass-by-value" semantics.
 java.lang.String getName()
          The name of a databinding should be case-insensitive and unique
 WrapperHandler getWrapperHandler()
          Provide a WrapperHandler for this databinding
 XMLTypeHelper getXMLTypeHelper()
          Get the XML type helper for Java types
 boolean introspect(DataType type, Operation operation)
          Introspect and populate information to a DataType model
 DataType introspect(java.lang.Object value, Operation operation)
          Introspect the data to figure out the corresponding data type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDataBinding

protected BaseDataBinding(java.lang.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

BaseDataBinding

protected BaseDataBinding(java.lang.String name,
                          java.lang.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

introspect

public boolean introspect(DataType type,
                          Operation operation)
Description copied from interface: DataBinding
Introspect and populate information to a DataType model

Specified by:
introspect in interface DataBinding
Parameters:
type - The data type to be introspected
operation - The operation
Returns:
true if the databinding has recognized the given data type

introspect

public DataType introspect(java.lang.Object value,
                           Operation operation)
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
operation - The operation
Returns:
The DataType or null if the java type is not supported by this databinding

getName

public final java.lang.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()

copy

public java.lang.Object copy(java.lang.Object object,
                             DataType dataType,
                             Operation operation)
Description copied from interface: DataBinding
Make a copy of the object for "pass-by-value" semantics.

Specified by:
copy in interface DataBinding
Parameters:
object - source object to copy
dataType - The data type
operation - The operation
Returns:
copy of the object passed in as argument

getXMLTypeHelper

public XMLTypeHelper getXMLTypeHelper()
Description copied from interface: DataBinding
Get the XML type helper for Java types

Specified by:
getXMLTypeHelper in interface DataBinding
Returns:
The databinding-specific XML type helper class