org.simantics.databoard.binding.factory
Class BindingFactory

java.lang.Object
  extended by org.simantics.databoard.binding.factory.BindingFactory
All Implemented Interfaces:
BindingScheme
Direct Known Subclasses:
DefaultBindingFactory, MutableBindingFactory

public abstract class BindingFactory
extends java.lang.Object
implements BindingScheme

Type Factory constructs data types from reflection requests. Successfully constructed types are placed in the repository that was given at construction time.

Author:
Toni Kalajainen

Constructor Summary
BindingFactory()
          Create a scheme factory.
BindingFactory(java.util.Map<Datatype,Binding> repository)
          Create scheme factory that appends constructed bindings to the user given repository
 
Method Summary
 Binding construct(Datatype request)
           
 Binding getBinding(Datatype type)
          Get binding of a data type
 Binding getBindingUnchecked(Datatype type)
          Get binding of a data type
 java.util.Map<Datatype,Binding> getRepository()
          Get Repository
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.simantics.databoard.binding.factory.BindingScheme
supportsType
 

Constructor Detail

BindingFactory

public BindingFactory()
Create a scheme factory.


BindingFactory

public BindingFactory(java.util.Map<Datatype,Binding> repository)
Create scheme factory that appends constructed bindings to the user given repository

Parameters:
repository - repository where bindings are placed
Method Detail

getRepository

public java.util.Map<Datatype,Binding> getRepository()
Get Repository

Returns:
binding repository

construct

public Binding construct(Datatype request)
                  throws BindingConstructionException
Throws:
BindingConstructionException

getBinding

public Binding getBinding(Datatype type)
                   throws BindingConstructionException
Description copied from interface: BindingScheme
Get binding of a data type

Specified by:
getBinding in interface BindingScheme
Parameters:
type - data type
Returns:
binding
Throws:
BindingConstructionException - if data type is not supported

getBindingUnchecked

public Binding getBindingUnchecked(Datatype type)
                            throws RuntimeBindingConstructionException
Description copied from interface: BindingScheme
Get binding of a data type

Specified by:
getBindingUnchecked in interface BindingScheme
Parameters:
type - data type
Returns:
binding
Throws:
RuntimeBindingConstructionException - if data type is not supported