net.sf.taverna.t2.util.beanable
Class BeanableFactory<BeanableType extends Beanable<BeanType>,BeanType>

java.lang.Object
  extended by net.sf.taverna.t2.util.beanable.BeanableFactory<BeanableType,BeanType>
Type Parameters:
BeanableType - The Beanable type
BeanType - The bean type of the Beanable.

public abstract class BeanableFactory<BeanableType extends Beanable<BeanType>,BeanType>
extends java.lang.Object

A factory for reconstructing a Beanable given a bean previously serialised from Beanable.getAsBean().

Each Beanable subclass should be matched with a subclass of BeanableFactory for producing the beanable from the bean.

This abstract class is an SPI, and it's concrete instances can be found by accessing BeanableFactoryRegistry. Implementations must be listed in META-INF/services/net.sf.taverna.t2.cloudone.bean.BeanableFactory to be found by the registry.

Author:
Ian Dunlop, Stian Soiland

Method Summary
 BeanableType createFromBean(BeanType bean)
          Construct a Beanable (an instance of the class returned from getBeanableType()) loaded from the given bean.
 java.lang.Class<BeanableType> getBeanableType()
          Get this factory's Beanable type.
 java.lang.Class<BeanType> getBeanType()
          Get this factory's bean type.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createFromBean

public BeanableType createFromBean(BeanType bean)
Construct a Beanable (an instance of the class returned from getBeanableType()) loaded from the given bean.

Parameters:
bean - Bean containing the data to reconstruct the Beanable. The bean must be an instance of the class of getBeanType().
Returns:
A new instance initialised from the bean

getBeanableType

public java.lang.Class<BeanableType> getBeanableType()
Get this factory's Beanable type. Instances of this class can be created using createFromBean(Object).

Returns:
The Beanable Class this factory produces

getBeanType

public java.lang.Class<BeanType> getBeanType()
Get this factory's bean type. Instances of this class can be used as argument to createFromBean(Object).

Returns:
The Class of the bean consumed by createFromBean(Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object