org.simantics.databoard.adapter
Interface Adapter

All Known Implementing Classes:
DefaultAdapter

public interface Adapter

Adapter converts one java class instance to another. Use Bindings.getAdapter(org.simantics.databoard.binding.Binding, org.simantics.databoard.binding.Binding) to instantiate an adapter between bindings.


Method Summary
 java.lang.Object adapt(java.lang.Object obj)
          Adapt instance of one binding to format of another binding.
 java.lang.Object adaptUnchecked(java.lang.Object obj)
          Adapt instance of one binding to format of another binding.
 

Method Detail

adapt

java.lang.Object adapt(java.lang.Object obj)
                       throws AdaptException
Adapt instance of one binding to format of another binding. Note! adapt may recycle the argument (use it in the result). This dependes on the implementation. Cloning adapter recycles only immutable instances.

Parameters:
obj - source instance
Returns:
result
Throws:
AdaptException

adaptUnchecked

java.lang.Object adaptUnchecked(java.lang.Object obj)
                                throws RuntimeAdaptException
Adapt instance of one binding to format of another binding. Note! adapt may recycle the argument (use it in the result). This dependes on the implementation. Cloning adapter recycles only immutable instances.

Parameters:
obj - source instance
Returns:
result
Throws:
RuntimeAdaptException